proteus  1.8.0
C/C++/Fortran libraries
superluWrappers.c
Go to the documentation of this file.
1 /* Generated by Cython 0.29.24 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8  #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10  #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_24"
13 #define CYTHON_HEX_VERSION 0x001D18F0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20  #ifndef __stdcall
21  #define __stdcall
22  #endif
23  #ifndef __cdecl
24  #define __cdecl
25  #endif
26  #ifndef __fastcall
27  #define __fastcall
28  #endif
29 #endif
30 #ifndef DL_IMPORT
31  #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34  #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38  #if PY_VERSION_HEX >= 0x02070000
39  #define HAVE_LONG_LONG
40  #endif
41 #endif
42 #ifndef PY_LONG_LONG
43  #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46  #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49  #define CYTHON_COMPILING_IN_PYPY 1
50  #define CYTHON_COMPILING_IN_PYSTON 0
51  #define CYTHON_COMPILING_IN_CPYTHON 0
52  #undef CYTHON_USE_TYPE_SLOTS
53  #define CYTHON_USE_TYPE_SLOTS 0
54  #undef CYTHON_USE_PYTYPE_LOOKUP
55  #define CYTHON_USE_PYTYPE_LOOKUP 0
56  #if PY_VERSION_HEX < 0x03050000
57  #undef CYTHON_USE_ASYNC_SLOTS
58  #define CYTHON_USE_ASYNC_SLOTS 0
59  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60  #define CYTHON_USE_ASYNC_SLOTS 1
61  #endif
62  #undef CYTHON_USE_PYLIST_INTERNALS
63  #define CYTHON_USE_PYLIST_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_INTERNALS
65  #define CYTHON_USE_UNICODE_INTERNALS 0
66  #undef CYTHON_USE_UNICODE_WRITER
67  #define CYTHON_USE_UNICODE_WRITER 0
68  #undef CYTHON_USE_PYLONG_INTERNALS
69  #define CYTHON_USE_PYLONG_INTERNALS 0
70  #undef CYTHON_AVOID_BORROWED_REFS
71  #define CYTHON_AVOID_BORROWED_REFS 1
72  #undef CYTHON_ASSUME_SAFE_MACROS
73  #define CYTHON_ASSUME_SAFE_MACROS 0
74  #undef CYTHON_UNPACK_METHODS
75  #define CYTHON_UNPACK_METHODS 0
76  #undef CYTHON_FAST_THREAD_STATE
77  #define CYTHON_FAST_THREAD_STATE 0
78  #undef CYTHON_FAST_PYCALL
79  #define CYTHON_FAST_PYCALL 0
80  #undef CYTHON_PEP489_MULTI_PHASE_INIT
81  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82  #undef CYTHON_USE_TP_FINALIZE
83  #define CYTHON_USE_TP_FINALIZE 0
84  #undef CYTHON_USE_DICT_VERSIONS
85  #define CYTHON_USE_DICT_VERSIONS 0
86  #undef CYTHON_USE_EXC_INFO_STACK
87  #define CYTHON_USE_EXC_INFO_STACK 0
88 #elif defined(PYSTON_VERSION)
89  #define CYTHON_COMPILING_IN_PYPY 0
90  #define CYTHON_COMPILING_IN_PYSTON 1
91  #define CYTHON_COMPILING_IN_CPYTHON 0
92  #ifndef CYTHON_USE_TYPE_SLOTS
93  #define CYTHON_USE_TYPE_SLOTS 1
94  #endif
95  #undef CYTHON_USE_PYTYPE_LOOKUP
96  #define CYTHON_USE_PYTYPE_LOOKUP 0
97  #undef CYTHON_USE_ASYNC_SLOTS
98  #define CYTHON_USE_ASYNC_SLOTS 0
99  #undef CYTHON_USE_PYLIST_INTERNALS
100  #define CYTHON_USE_PYLIST_INTERNALS 0
101  #ifndef CYTHON_USE_UNICODE_INTERNALS
102  #define CYTHON_USE_UNICODE_INTERNALS 1
103  #endif
104  #undef CYTHON_USE_UNICODE_WRITER
105  #define CYTHON_USE_UNICODE_WRITER 0
106  #undef CYTHON_USE_PYLONG_INTERNALS
107  #define CYTHON_USE_PYLONG_INTERNALS 0
108  #ifndef CYTHON_AVOID_BORROWED_REFS
109  #define CYTHON_AVOID_BORROWED_REFS 0
110  #endif
111  #ifndef CYTHON_ASSUME_SAFE_MACROS
112  #define CYTHON_ASSUME_SAFE_MACROS 1
113  #endif
114  #ifndef CYTHON_UNPACK_METHODS
115  #define CYTHON_UNPACK_METHODS 1
116  #endif
117  #undef CYTHON_FAST_THREAD_STATE
118  #define CYTHON_FAST_THREAD_STATE 0
119  #undef CYTHON_FAST_PYCALL
120  #define CYTHON_FAST_PYCALL 0
121  #undef CYTHON_PEP489_MULTI_PHASE_INIT
122  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
123  #undef CYTHON_USE_TP_FINALIZE
124  #define CYTHON_USE_TP_FINALIZE 0
125  #undef CYTHON_USE_DICT_VERSIONS
126  #define CYTHON_USE_DICT_VERSIONS 0
127  #undef CYTHON_USE_EXC_INFO_STACK
128  #define CYTHON_USE_EXC_INFO_STACK 0
129 #else
130  #define CYTHON_COMPILING_IN_PYPY 0
131  #define CYTHON_COMPILING_IN_PYSTON 0
132  #define CYTHON_COMPILING_IN_CPYTHON 1
133  #ifndef CYTHON_USE_TYPE_SLOTS
134  #define CYTHON_USE_TYPE_SLOTS 1
135  #endif
136  #if PY_VERSION_HEX < 0x02070000
137  #undef CYTHON_USE_PYTYPE_LOOKUP
138  #define CYTHON_USE_PYTYPE_LOOKUP 0
139  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
140  #define CYTHON_USE_PYTYPE_LOOKUP 1
141  #endif
142  #if PY_MAJOR_VERSION < 3
143  #undef CYTHON_USE_ASYNC_SLOTS
144  #define CYTHON_USE_ASYNC_SLOTS 0
145  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
146  #define CYTHON_USE_ASYNC_SLOTS 1
147  #endif
148  #if PY_VERSION_HEX < 0x02070000
149  #undef CYTHON_USE_PYLONG_INTERNALS
150  #define CYTHON_USE_PYLONG_INTERNALS 0
151  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
152  #define CYTHON_USE_PYLONG_INTERNALS 1
153  #endif
154  #ifndef CYTHON_USE_PYLIST_INTERNALS
155  #define CYTHON_USE_PYLIST_INTERNALS 1
156  #endif
157  #ifndef CYTHON_USE_UNICODE_INTERNALS
158  #define CYTHON_USE_UNICODE_INTERNALS 1
159  #endif
160  #if PY_VERSION_HEX < 0x030300F0
161  #undef CYTHON_USE_UNICODE_WRITER
162  #define CYTHON_USE_UNICODE_WRITER 0
163  #elif !defined(CYTHON_USE_UNICODE_WRITER)
164  #define CYTHON_USE_UNICODE_WRITER 1
165  #endif
166  #ifndef CYTHON_AVOID_BORROWED_REFS
167  #define CYTHON_AVOID_BORROWED_REFS 0
168  #endif
169  #ifndef CYTHON_ASSUME_SAFE_MACROS
170  #define CYTHON_ASSUME_SAFE_MACROS 1
171  #endif
172  #ifndef CYTHON_UNPACK_METHODS
173  #define CYTHON_UNPACK_METHODS 1
174  #endif
175  #ifndef CYTHON_FAST_THREAD_STATE
176  #define CYTHON_FAST_THREAD_STATE 1
177  #endif
178  #ifndef CYTHON_FAST_PYCALL
179  #define CYTHON_FAST_PYCALL 1
180  #endif
181  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
182  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
183  #endif
184  #ifndef CYTHON_USE_TP_FINALIZE
185  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
186  #endif
187  #ifndef CYTHON_USE_DICT_VERSIONS
188  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
189  #endif
190  #ifndef CYTHON_USE_EXC_INFO_STACK
191  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192  #endif
193 #endif
194 #if !defined(CYTHON_FAST_PYCCALL)
195 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
196 #endif
197 #if CYTHON_USE_PYLONG_INTERNALS
198  #include "longintrepr.h"
199  #undef SHIFT
200  #undef BASE
201  #undef MASK
202  #ifdef SIZEOF_VOID_P
203  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
204  #endif
205 #endif
206 #ifndef __has_attribute
207  #define __has_attribute(x) 0
208 #endif
209 #ifndef __has_cpp_attribute
210  #define __has_cpp_attribute(x) 0
211 #endif
212 #ifndef CYTHON_RESTRICT
213  #if defined(__GNUC__)
214  #define CYTHON_RESTRICT __restrict__
215  #elif defined(_MSC_VER) && _MSC_VER >= 1400
216  #define CYTHON_RESTRICT __restrict
217  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218  #define CYTHON_RESTRICT restrict
219  #else
220  #define CYTHON_RESTRICT
221  #endif
222 #endif
223 #ifndef CYTHON_UNUSED
224 # if defined(__GNUC__)
225 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
226 # define CYTHON_UNUSED __attribute__ ((__unused__))
227 # else
228 # define CYTHON_UNUSED
229 # endif
230 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
231 # define CYTHON_UNUSED __attribute__ ((__unused__))
232 # else
233 # define CYTHON_UNUSED
234 # endif
235 #endif
236 #ifndef CYTHON_MAYBE_UNUSED_VAR
237 # if defined(__cplusplus)
238  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
239 # else
240 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
241 # endif
242 #endif
243 #ifndef CYTHON_NCP_UNUSED
244 # if CYTHON_COMPILING_IN_CPYTHON
245 # define CYTHON_NCP_UNUSED
246 # else
247 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
248 # endif
249 #endif
250 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
251 #ifdef _MSC_VER
252  #ifndef _MSC_STDINT_H_
253  #if _MSC_VER < 1300
254  typedef unsigned char uint8_t;
255  typedef unsigned int uint32_t;
256  #else
257  typedef unsigned __int8 uint8_t;
258  typedef unsigned __int32 uint32_t;
259  #endif
260  #endif
261 #else
262  #include <stdint.h>
263 #endif
264 #ifndef CYTHON_FALLTHROUGH
265  #if defined(__cplusplus) && __cplusplus >= 201103L
266  #if __has_cpp_attribute(fallthrough)
267  #define CYTHON_FALLTHROUGH [[fallthrough]]
268  #elif __has_cpp_attribute(clang::fallthrough)
269  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
270  #elif __has_cpp_attribute(gnu::fallthrough)
271  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
272  #endif
273  #endif
274  #ifndef CYTHON_FALLTHROUGH
275  #if __has_attribute(fallthrough)
276  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
277  #else
278  #define CYTHON_FALLTHROUGH
279  #endif
280  #endif
281  #if defined(__clang__ ) && defined(__apple_build_version__)
282  #if __apple_build_version__ < 7000000
283  #undef CYTHON_FALLTHROUGH
284  #define CYTHON_FALLTHROUGH
285  #endif
286  #endif
287 #endif
288 
289 #ifndef CYTHON_INLINE
290  #if defined(__clang__)
291  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
292  #elif defined(__GNUC__)
293  #define CYTHON_INLINE __inline__
294  #elif defined(_MSC_VER)
295  #define CYTHON_INLINE __inline
296  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
297  #define CYTHON_INLINE inline
298  #else
299  #define CYTHON_INLINE
300  #endif
301 #endif
302 
303 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
304  #define Py_OptimizeFlag 0
305 #endif
306 #define __PYX_BUILD_PY_SSIZE_T "n"
307 #define CYTHON_FORMAT_SSIZE_T "z"
308 #if PY_MAJOR_VERSION < 3
309  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
310  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
311  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
312  #define __Pyx_DefaultClassType PyClass_Type
313 #else
314  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
315 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
316  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
317  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
318 #else
319  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
320  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
321 #endif
322  #define __Pyx_DefaultClassType PyType_Type
323 #endif
324 #ifndef Py_TPFLAGS_CHECKTYPES
325  #define Py_TPFLAGS_CHECKTYPES 0
326 #endif
327 #ifndef Py_TPFLAGS_HAVE_INDEX
328  #define Py_TPFLAGS_HAVE_INDEX 0
329 #endif
330 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
331  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
332 #endif
333 #ifndef Py_TPFLAGS_HAVE_FINALIZE
334  #define Py_TPFLAGS_HAVE_FINALIZE 0
335 #endif
336 #ifndef METH_STACKLESS
337  #define METH_STACKLESS 0
338 #endif
339 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
340  #ifndef METH_FASTCALL
341  #define METH_FASTCALL 0x80
342  #endif
343  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
344  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
345  Py_ssize_t nargs, PyObject *kwnames);
346 #else
347  #define __Pyx_PyCFunctionFast _PyCFunctionFast
348  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
349 #endif
350 #if CYTHON_FAST_PYCCALL
351 #define __Pyx_PyFastCFunction_Check(func)\
352  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
353 #else
354 #define __Pyx_PyFastCFunction_Check(func) 0
355 #endif
356 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
357  #define PyObject_Malloc(s) PyMem_Malloc(s)
358  #define PyObject_Free(p) PyMem_Free(p)
359  #define PyObject_Realloc(p) PyMem_Realloc(p)
360 #endif
361 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
362  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
363  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
364  #define PyMem_RawFree(p) PyMem_Free(p)
365 #endif
366 #if CYTHON_COMPILING_IN_PYSTON
367  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
368  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
369 #else
370  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
371  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
372 #endif
373 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
374  #define __Pyx_PyThreadState_Current PyThreadState_GET()
375 #elif PY_VERSION_HEX >= 0x03060000
376  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
377 #elif PY_VERSION_HEX >= 0x03000000
378  #define __Pyx_PyThreadState_Current PyThreadState_GET()
379 #else
380  #define __Pyx_PyThreadState_Current _PyThreadState_Current
381 #endif
382 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
383 #include "pythread.h"
384 #define Py_tss_NEEDS_INIT 0
385 typedef int Py_tss_t;
386 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
387  *key = PyThread_create_key();
388  return 0;
389 }
390 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
391  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
392  *key = Py_tss_NEEDS_INIT;
393  return key;
394 }
395 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
396  PyObject_Free(key);
397 }
398 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
399  return *key != Py_tss_NEEDS_INIT;
400 }
401 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
402  PyThread_delete_key(*key);
403  *key = Py_tss_NEEDS_INIT;
404 }
405 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
406  return PyThread_set_key_value(*key, value);
407 }
408 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
409  return PyThread_get_key_value(*key);
410 }
411 #endif
412 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
413 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
414 #else
415 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
416 #endif
417 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
418  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
419  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
420 #else
421  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
422  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
423 #endif
424 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
425 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
426 #else
427 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
428 #endif
429 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
430  #define CYTHON_PEP393_ENABLED 1
431  #if defined(PyUnicode_IS_READY)
432  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
433  0 : _PyUnicode_Ready((PyObject *)(op)))
434  #else
435  #define __Pyx_PyUnicode_READY(op) (0)
436  #endif
437  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
438  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
439  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
440  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
441  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
442  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
443  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
444  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
445  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
446  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
447  #else
448  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
449  #endif
450  #else
451  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
452  #endif
453 #else
454  #define CYTHON_PEP393_ENABLED 0
455  #define PyUnicode_1BYTE_KIND 1
456  #define PyUnicode_2BYTE_KIND 2
457  #define PyUnicode_4BYTE_KIND 4
458  #define __Pyx_PyUnicode_READY(op) (0)
459  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
460  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
461  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
462  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
463  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
464  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
465  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
466  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
467 #endif
468 #if CYTHON_COMPILING_IN_PYPY
469  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
470  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
471 #else
472  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
473  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
474  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
475 #endif
476 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
477  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
478 #endif
479 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
480  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
481 #endif
482 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
483  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
484 #endif
485 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
486 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
487 #if PY_MAJOR_VERSION >= 3
488  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
489 #else
490  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
491 #endif
492 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
493  #define PyObject_ASCII(o) PyObject_Repr(o)
494 #endif
495 #if PY_MAJOR_VERSION >= 3
496  #define PyBaseString_Type PyUnicode_Type
497  #define PyStringObject PyUnicodeObject
498  #define PyString_Type PyUnicode_Type
499  #define PyString_Check PyUnicode_Check
500  #define PyString_CheckExact PyUnicode_CheckExact
501 #ifndef PyObject_Unicode
502  #define PyObject_Unicode PyObject_Str
503 #endif
504 #endif
505 #if PY_MAJOR_VERSION >= 3
506  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
507  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
508 #else
509  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
510  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
511 #endif
512 #ifndef PySet_CheckExact
513  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
514 #endif
515 #if PY_VERSION_HEX >= 0x030900A4
516  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
517  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
518 #else
519  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
520  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
521 #endif
522 #if CYTHON_ASSUME_SAFE_MACROS
523  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
524 #else
525  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
526 #endif
527 #if PY_MAJOR_VERSION >= 3
528  #define PyIntObject PyLongObject
529  #define PyInt_Type PyLong_Type
530  #define PyInt_Check(op) PyLong_Check(op)
531  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
532  #define PyInt_FromString PyLong_FromString
533  #define PyInt_FromUnicode PyLong_FromUnicode
534  #define PyInt_FromLong PyLong_FromLong
535  #define PyInt_FromSize_t PyLong_FromSize_t
536  #define PyInt_FromSsize_t PyLong_FromSsize_t
537  #define PyInt_AsLong PyLong_AsLong
538  #define PyInt_AS_LONG PyLong_AS_LONG
539  #define PyInt_AsSsize_t PyLong_AsSsize_t
540  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
541  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
542  #define PyNumber_Int PyNumber_Long
543 #endif
544 #if PY_MAJOR_VERSION >= 3
545  #define PyBoolObject PyLongObject
546 #endif
547 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
548  #ifndef PyUnicode_InternFromString
549  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
550  #endif
551 #endif
552 #if PY_VERSION_HEX < 0x030200A4
553  typedef long Py_hash_t;
554  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
555  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
556 #else
557  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
558  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
559 #endif
560 #if PY_MAJOR_VERSION >= 3
561  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
562 #else
563  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
564 #endif
565 #if CYTHON_USE_ASYNC_SLOTS
566  #if PY_VERSION_HEX >= 0x030500B1
567  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
568  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
569  #else
570  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
571  #endif
572 #else
573  #define __Pyx_PyType_AsAsync(obj) NULL
574 #endif
575 #ifndef __Pyx_PyAsyncMethodsStruct
576  typedef struct {
577  unaryfunc am_await;
578  unaryfunc am_aiter;
579  unaryfunc am_anext;
580  } __Pyx_PyAsyncMethodsStruct;
581 #endif
582 
583 #if defined(WIN32) || defined(MS_WINDOWS)
584  #define _USE_MATH_DEFINES
585 #endif
586 #include <math.h>
587 #ifdef NAN
588 #define __PYX_NAN() ((float) NAN)
589 #else
590 static CYTHON_INLINE float __PYX_NAN() {
591  float value;
592  memset(&value, 0xFF, sizeof(value));
593  return value;
594 }
595 #endif
596 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
597 #define __Pyx_truncl trunc
598 #else
599 #define __Pyx_truncl truncl
600 #endif
601 
602 #define __PYX_MARK_ERR_POS(f_index, lineno) \
603  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
604 #define __PYX_ERR(f_index, lineno, Ln_error) \
605  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
606 
607 #ifndef __PYX_EXTERN_C
608  #ifdef __cplusplus
609  #define __PYX_EXTERN_C extern "C"
610  #else
611  #define __PYX_EXTERN_C extern
612  #endif
613 #endif
614 
615 #define __PYX_HAVE__superluWrappers
616 #define __PYX_HAVE_API__superluWrappers
617 /* Early includes */
618 #include <string.h>
619 #include <stdio.h>
620 #include "numpy/arrayobject.h"
621 #include "numpy/ndarrayobject.h"
622 #include "numpy/ndarraytypes.h"
623 #include "numpy/arrayscalars.h"
624 #include "numpy/ufuncobject.h"
625 
626  /* NumPy API declarations from "numpy/__init__.pxd" */
627 
628 #include "proteus_superlu.h"
629 #include <stdlib.h>
630 #include "pythread.h"
631 #include "pystate.h"
632 #ifdef _OPENMP
633 #include <omp.h>
634 #endif /* _OPENMP */
635 
636 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
637 #define CYTHON_WITHOUT_ASSERTIONS
638 #endif
639 
640 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
641  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
642 
643 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
644 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
645 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
646 #define __PYX_DEFAULT_STRING_ENCODING ""
647 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
648 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
649 #define __Pyx_uchar_cast(c) ((unsigned char)c)
650 #define __Pyx_long_cast(x) ((long)x)
651 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
652  (sizeof(type) < sizeof(Py_ssize_t)) ||\
653  (sizeof(type) > sizeof(Py_ssize_t) &&\
654  likely(v < (type)PY_SSIZE_T_MAX ||\
655  v == (type)PY_SSIZE_T_MAX) &&\
656  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
657  v == (type)PY_SSIZE_T_MIN))) ||\
658  (sizeof(type) == sizeof(Py_ssize_t) &&\
659  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
660  v == (type)PY_SSIZE_T_MAX))) )
661 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
662  return (size_t) i < (size_t) limit;
663 }
664 #if defined (__cplusplus) && __cplusplus >= 201103L
665  #include <cstdlib>
666  #define __Pyx_sst_abs(value) std::abs(value)
667 #elif SIZEOF_INT >= SIZEOF_SIZE_T
668  #define __Pyx_sst_abs(value) abs(value)
669 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
670  #define __Pyx_sst_abs(value) labs(value)
671 #elif defined (_MSC_VER)
672  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
673 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
674  #define __Pyx_sst_abs(value) llabs(value)
675 #elif defined (__GNUC__)
676  #define __Pyx_sst_abs(value) __builtin_llabs(value)
677 #else
678  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
679 #endif
680 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
681 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
682 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
683 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
684 #define __Pyx_PyBytes_FromString PyBytes_FromString
685 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
686 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
687 #if PY_MAJOR_VERSION < 3
688  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
689  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
690 #else
691  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
692  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
693 #endif
694 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
698 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
699 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
700 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
701 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
702 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
703 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
704 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
705 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
706 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
707 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
708 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
709 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
710 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
711  const Py_UNICODE *u_end = u;
712  while (*u_end++) ;
713  return (size_t)(u_end - u - 1);
714 }
715 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
716 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
717 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
718 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
719 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
720 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
721 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
722 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
723 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
724 #define __Pyx_PySequence_Tuple(obj)\
725  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
726 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
727 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
728 #if CYTHON_ASSUME_SAFE_MACROS
729 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
730 #else
731 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
732 #endif
733 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
734 #if PY_MAJOR_VERSION >= 3
735 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
736 #else
737 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
738 #endif
739 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
740 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
741 static int __Pyx_sys_getdefaultencoding_not_ascii;
742 static int __Pyx_init_sys_getdefaultencoding_params(void) {
743  PyObject* sys;
744  PyObject* default_encoding = NULL;
745  PyObject* ascii_chars_u = NULL;
746  PyObject* ascii_chars_b = NULL;
747  const char* default_encoding_c;
748  sys = PyImport_ImportModule("sys");
749  if (!sys) goto bad;
750  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
751  Py_DECREF(sys);
752  if (!default_encoding) goto bad;
753  default_encoding_c = PyBytes_AsString(default_encoding);
754  if (!default_encoding_c) goto bad;
755  if (strcmp(default_encoding_c, "ascii") == 0) {
756  __Pyx_sys_getdefaultencoding_not_ascii = 0;
757  } else {
758  char ascii_chars[128];
759  int c;
760  for (c = 0; c < 128; c++) {
761  ascii_chars[c] = c;
762  }
763  __Pyx_sys_getdefaultencoding_not_ascii = 1;
764  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
765  if (!ascii_chars_u) goto bad;
766  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
767  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
768  PyErr_Format(
769  PyExc_ValueError,
770  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
771  default_encoding_c);
772  goto bad;
773  }
774  Py_DECREF(ascii_chars_u);
775  Py_DECREF(ascii_chars_b);
776  }
777  Py_DECREF(default_encoding);
778  return 0;
779 bad:
780  Py_XDECREF(default_encoding);
781  Py_XDECREF(ascii_chars_u);
782  Py_XDECREF(ascii_chars_b);
783  return -1;
784 }
785 #endif
786 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
787 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
788 #else
789 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
790 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
791 static char* __PYX_DEFAULT_STRING_ENCODING;
792 static int __Pyx_init_sys_getdefaultencoding_params(void) {
793  PyObject* sys;
794  PyObject* default_encoding = NULL;
795  char* default_encoding_c;
796  sys = PyImport_ImportModule("sys");
797  if (!sys) goto bad;
798  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
799  Py_DECREF(sys);
800  if (!default_encoding) goto bad;
801  default_encoding_c = PyBytes_AsString(default_encoding);
802  if (!default_encoding_c) goto bad;
803  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
804  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
805  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
806  Py_DECREF(default_encoding);
807  return 0;
808 bad:
809  Py_XDECREF(default_encoding);
810  return -1;
811 }
812 #endif
813 #endif
814 
815 
816 /* Test for GCC > 2.95 */
817 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
818  #define likely(x) __builtin_expect(!!(x), 1)
819  #define unlikely(x) __builtin_expect(!!(x), 0)
820 #else /* !__GNUC__ or GCC < 2.95 */
821  #define likely(x) (x)
822  #define unlikely(x) (x)
823 #endif /* __GNUC__ */
824 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
825 
826 static PyObject *__pyx_m = NULL;
827 static PyObject *__pyx_d;
828 static PyObject *__pyx_b;
829 static PyObject *__pyx_cython_runtime = NULL;
830 static PyObject *__pyx_empty_tuple;
831 static PyObject *__pyx_empty_bytes;
832 static PyObject *__pyx_empty_unicode;
833 static int __pyx_lineno;
834 static int __pyx_clineno = 0;
835 static const char * __pyx_cfilenm= __FILE__;
836 static const char *__pyx_filename;
837 
838 /* Header.proto */
839 #if !defined(CYTHON_CCOMPLEX)
840  #if defined(__cplusplus)
841  #define CYTHON_CCOMPLEX 1
842  #elif defined(_Complex_I)
843  #define CYTHON_CCOMPLEX 1
844  #else
845  #define CYTHON_CCOMPLEX 0
846  #endif
847 #endif
848 #if CYTHON_CCOMPLEX
849  #ifdef __cplusplus
850  #include <complex>
851  #else
852  #include <complex.h>
853  #endif
854 #endif
855 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
856  #undef _Complex_I
857  #define _Complex_I 1.0fj
858 #endif
859 
860 
861 static const char *__pyx_f[] = {
862  "proteus/superluWrappers.pyx",
863  "stringsource",
864  "__init__.pxd",
865  "type.pxd",
866 };
867 /* MemviewSliceStruct.proto */
868 struct __pyx_memoryview_obj;
869 typedef struct {
870  struct __pyx_memoryview_obj *memview;
871  char *data;
872  Py_ssize_t shape[8];
873  Py_ssize_t strides[8];
874  Py_ssize_t suboffsets[8];
875 } __Pyx_memviewslice;
876 #define __Pyx_MemoryView_Len(m) (m.shape[0])
877 
878 /* Atomics.proto */
879 #include <pythread.h>
880 #ifndef CYTHON_ATOMICS
881  #define CYTHON_ATOMICS 1
882 #endif
883 #define __pyx_atomic_int_type int
884 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
885  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
886  !defined(__i386__)
887  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
888  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
889  #ifdef __PYX_DEBUG_ATOMICS
890  #warning "Using GNU atomics"
891  #endif
892 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
893  #include <Windows.h>
894  #undef __pyx_atomic_int_type
895  #define __pyx_atomic_int_type LONG
896  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
897  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
898  #ifdef __PYX_DEBUG_ATOMICS
899  #pragma message ("Using MSVC atomics")
900  #endif
901 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
902  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
903  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
904  #ifdef __PYX_DEBUG_ATOMICS
905  #warning "Using Intel atomics"
906  #endif
907 #else
908  #undef CYTHON_ATOMICS
909  #define CYTHON_ATOMICS 0
910  #ifdef __PYX_DEBUG_ATOMICS
911  #warning "Not using atomics"
912  #endif
913 #endif
914 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
915 #if CYTHON_ATOMICS
916  #define __pyx_add_acquisition_count(memview)\
917  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
918  #define __pyx_sub_acquisition_count(memview)\
919  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
920 #else
921  #define __pyx_add_acquisition_count(memview)\
922  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
923  #define __pyx_sub_acquisition_count(memview)\
924  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
925 #endif
926 
927 /* ForceInitThreads.proto */
928 #ifndef __PYX_FORCE_INIT_THREADS
929  #define __PYX_FORCE_INIT_THREADS 0
930 #endif
931 
932 /* NoFastGil.proto */
933 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
934 #define __Pyx_PyGILState_Release PyGILState_Release
935 #define __Pyx_FastGIL_Remember()
936 #define __Pyx_FastGIL_Forget()
937 #define __Pyx_FastGilFuncInit()
938 
939 /* BufferFormatStructs.proto */
940 #define IS_UNSIGNED(type) (((type) -1) > 0)
941 struct __Pyx_StructField_;
942 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
943 typedef struct {
944  const char* name;
945  struct __Pyx_StructField_* fields;
946  size_t size;
947  size_t arraysize[8];
948  int ndim;
949  char typegroup;
950  char is_unsigned;
951  int flags;
952 } __Pyx_TypeInfo;
953 typedef struct __Pyx_StructField_ {
954  __Pyx_TypeInfo* type;
955  const char* name;
956  size_t offset;
957 } __Pyx_StructField;
958 typedef struct {
959  __Pyx_StructField* field;
960  size_t parent_offset;
961 } __Pyx_BufFmt_StackElem;
962 typedef struct {
963  __Pyx_StructField root;
964  __Pyx_BufFmt_StackElem* head;
965  size_t fmt_offset;
966  size_t new_count, enc_count;
967  size_t struct_alignment;
968  int is_complex;
969  char enc_type;
970  char new_packmode;
971  char enc_packmode;
972  char is_valid_array;
973 } __Pyx_BufFmt_Context;
974 
975 
976 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":690
977  * # in Cython to enable them only on the right systems.
978  *
979  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
980  * ctypedef npy_int16 int16_t
981  * ctypedef npy_int32 int32_t
982  */
983 typedef npy_int8 __pyx_t_5numpy_int8_t;
984 
985 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":691
986  *
987  * ctypedef npy_int8 int8_t
988  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
989  * ctypedef npy_int32 int32_t
990  * ctypedef npy_int64 int64_t
991  */
992 typedef npy_int16 __pyx_t_5numpy_int16_t;
993 
994 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":692
995  * ctypedef npy_int8 int8_t
996  * ctypedef npy_int16 int16_t
997  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
998  * ctypedef npy_int64 int64_t
999  * #ctypedef npy_int96 int96_t
1000  */
1001 typedef npy_int32 __pyx_t_5numpy_int32_t;
1002 
1003 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":693
1004  * ctypedef npy_int16 int16_t
1005  * ctypedef npy_int32 int32_t
1006  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1007  * #ctypedef npy_int96 int96_t
1008  * #ctypedef npy_int128 int128_t
1009  */
1010 typedef npy_int64 __pyx_t_5numpy_int64_t;
1011 
1012 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":697
1013  * #ctypedef npy_int128 int128_t
1014  *
1015  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1016  * ctypedef npy_uint16 uint16_t
1017  * ctypedef npy_uint32 uint32_t
1018  */
1019 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1020 
1021 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":698
1022  *
1023  * ctypedef npy_uint8 uint8_t
1024  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1025  * ctypedef npy_uint32 uint32_t
1026  * ctypedef npy_uint64 uint64_t
1027  */
1028 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1029 
1030 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":699
1031  * ctypedef npy_uint8 uint8_t
1032  * ctypedef npy_uint16 uint16_t
1033  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1034  * ctypedef npy_uint64 uint64_t
1035  * #ctypedef npy_uint96 uint96_t
1036  */
1037 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1038 
1039 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":700
1040  * ctypedef npy_uint16 uint16_t
1041  * ctypedef npy_uint32 uint32_t
1042  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1043  * #ctypedef npy_uint96 uint96_t
1044  * #ctypedef npy_uint128 uint128_t
1045  */
1046 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1047 
1048 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":704
1049  * #ctypedef npy_uint128 uint128_t
1050  *
1051  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1052  * ctypedef npy_float64 float64_t
1053  * #ctypedef npy_float80 float80_t
1054  */
1055 typedef npy_float32 __pyx_t_5numpy_float32_t;
1056 
1057 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":705
1058  *
1059  * ctypedef npy_float32 float32_t
1060  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1061  * #ctypedef npy_float80 float80_t
1062  * #ctypedef npy_float128 float128_t
1063  */
1064 typedef npy_float64 __pyx_t_5numpy_float64_t;
1065 
1066 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":714
1067  * # The int types are mapped a bit surprising --
1068  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1069  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1070  * ctypedef npy_longlong long_t
1071  * ctypedef npy_longlong longlong_t
1072  */
1073 typedef npy_long __pyx_t_5numpy_int_t;
1074 
1075 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":715
1076  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1077  * ctypedef npy_long int_t
1078  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1079  * ctypedef npy_longlong longlong_t
1080  *
1081  */
1082 typedef npy_longlong __pyx_t_5numpy_long_t;
1083 
1084 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":716
1085  * ctypedef npy_long int_t
1086  * ctypedef npy_longlong long_t
1087  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1088  *
1089  * ctypedef npy_ulong uint_t
1090  */
1091 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1092 
1093 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":718
1094  * ctypedef npy_longlong longlong_t
1095  *
1096  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1097  * ctypedef npy_ulonglong ulong_t
1098  * ctypedef npy_ulonglong ulonglong_t
1099  */
1100 typedef npy_ulong __pyx_t_5numpy_uint_t;
1101 
1102 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":719
1103  *
1104  * ctypedef npy_ulong uint_t
1105  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1106  * ctypedef npy_ulonglong ulonglong_t
1107  *
1108  */
1109 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1110 
1111 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":720
1112  * ctypedef npy_ulong uint_t
1113  * ctypedef npy_ulonglong ulong_t
1114  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1115  *
1116  * ctypedef npy_intp intp_t
1117  */
1118 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1119 
1120 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":722
1121  * ctypedef npy_ulonglong ulonglong_t
1122  *
1123  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1124  * ctypedef npy_uintp uintp_t
1125  *
1126  */
1127 typedef npy_intp __pyx_t_5numpy_intp_t;
1128 
1129 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":723
1130  *
1131  * ctypedef npy_intp intp_t
1132  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1133  *
1134  * ctypedef npy_double float_t
1135  */
1136 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1137 
1138 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":725
1139  * ctypedef npy_uintp uintp_t
1140  *
1141  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1142  * ctypedef npy_double double_t
1143  * ctypedef npy_longdouble longdouble_t
1144  */
1145 typedef npy_double __pyx_t_5numpy_float_t;
1146 
1147 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":726
1148  *
1149  * ctypedef npy_double float_t
1150  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1151  * ctypedef npy_longdouble longdouble_t
1152  *
1153  */
1154 typedef npy_double __pyx_t_5numpy_double_t;
1155 
1156 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":727
1157  * ctypedef npy_double float_t
1158  * ctypedef npy_double double_t
1159  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1160  *
1161  * ctypedef npy_cfloat cfloat_t
1162  */
1163 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1164 /* Declarations.proto */
1165 #if CYTHON_CCOMPLEX
1166  #ifdef __cplusplus
1167  typedef ::std::complex< float > __pyx_t_float_complex;
1168  #else
1169  typedef float _Complex __pyx_t_float_complex;
1170  #endif
1171 #else
1172  typedef struct { float real, imag; } __pyx_t_float_complex;
1173 #endif
1174 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1175 
1176 /* Declarations.proto */
1177 #if CYTHON_CCOMPLEX
1178  #ifdef __cplusplus
1179  typedef ::std::complex< double > __pyx_t_double_complex;
1180  #else
1181  typedef double _Complex __pyx_t_double_complex;
1182  #endif
1183 #else
1184  typedef struct { double real, imag; } __pyx_t_double_complex;
1185 #endif
1186 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1187 
1188 
1189 /*--- Type declarations ---*/
1190 struct __pyx_obj_15superluWrappers_cSparseMatrix;
1191 struct __pyx_obj_15superluWrappers_SparseFactor;
1192 struct __pyx_array_obj;
1193 struct __pyx_MemviewEnum_obj;
1194 struct __pyx_memoryview_obj;
1195 struct __pyx_memoryviewslice_obj;
1196 
1197 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":729
1198  * ctypedef npy_longdouble longdouble_t
1199  *
1200  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1201  * ctypedef npy_cdouble cdouble_t
1202  * ctypedef npy_clongdouble clongdouble_t
1203  */
1204 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1205 
1206 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":730
1207  *
1208  * ctypedef npy_cfloat cfloat_t
1209  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1210  * ctypedef npy_clongdouble clongdouble_t
1211  *
1212  */
1213 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1214 
1215 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":731
1216  * ctypedef npy_cfloat cfloat_t
1217  * ctypedef npy_cdouble cdouble_t
1218  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1219  *
1220  * ctypedef npy_cdouble complex_t
1221  */
1222 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1223 
1224 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":733
1225  * ctypedef npy_clongdouble clongdouble_t
1226  *
1227  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1228  *
1229  * cdef inline object PyArray_MultiIterNew1(a):
1230  */
1231 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1232 struct __pyx_t_15superluWrappers__NRformat;
1233 struct __pyx_t_15superluWrappers__NCformat;
1234 struct __pyx_t_15superluWrappers__DNformat;
1235 struct __pyx_t_15superluWrappers__NCPformat;
1236 
1237 /* "superluWrappers.pxd":61
1238  * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
1239  *
1240  * cdef struct _NRformat: # <<<<<<<<<<<<<<
1241  * np.int32_t nnz
1242  * np.float64_t * nzval
1243  */
1244 struct __pyx_t_15superluWrappers__NRformat {
1245  __pyx_t_5numpy_int32_t nnz;
1246  __pyx_t_5numpy_float64_t *nzval;
1247  __pyx_t_5numpy_int32_t *colind;
1248  __pyx_t_5numpy_int32_t *rowptr;
1249 };
1250 
1251 /* "superluWrappers.pyx":128
1252  * yp[i] = tmp
1253  *
1254  * cdef struct _NCformat: # <<<<<<<<<<<<<<
1255  * np.int32_t nnz
1256  * np.float64_t * nzval
1257  */
1258 struct __pyx_t_15superluWrappers__NCformat {
1259  __pyx_t_5numpy_int32_t nnz;
1260  __pyx_t_5numpy_float64_t *nzval;
1261  __pyx_t_5numpy_int32_t *rowind;
1262  __pyx_t_5numpy_int32_t *colptr;
1263 };
1264 
1265 /* "superluWrappers.pyx":134
1266  * np.int32_t * colptr
1267  *
1268  * cdef struct _DNformat: # <<<<<<<<<<<<<<
1269  * np.int32_t lda
1270  * void *nzval
1271  */
1272 struct __pyx_t_15superluWrappers__DNformat {
1273  __pyx_t_5numpy_int32_t lda;
1274  void *nzval;
1275 };
1276 
1277 /* "superluWrappers.pyx":138
1278  * void *nzval
1279  *
1280  * cdef struct _NCPformat: # <<<<<<<<<<<<<<
1281  * np.int32_t nnz
1282  * void * nzval
1283  */
1284 struct __pyx_t_15superluWrappers__NCPformat {
1285  __pyx_t_5numpy_int32_t nnz;
1286  void *nzval;
1287  __pyx_t_5numpy_int32_t *rowind;
1288  __pyx_t_5numpy_int32_t *colbeg;
1289  __pyx_t_5numpy_int32_t *colend;
1290 };
1291 
1292 /* "superluWrappers.pxd":67
1293  * np.int32_t * rowptr
1294  *
1295  * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
1296  * cdef np.int32_t dim[2]
1297  * cdef _NRformat A
1298  */
1299 struct __pyx_obj_15superluWrappers_cSparseMatrix {
1300  PyObject_HEAD
1301  __pyx_t_5numpy_int32_t dim[2];
1302  struct __pyx_t_15superluWrappers__NRformat A;
1303 };
1304 
1305 
1306 /* "superluWrappers.pyx":145
1307  * np.int32_t * colend
1308  *
1309  * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
1310  *
1311  * cdef _superlu_options_t options
1312  */
1313 struct __pyx_obj_15superluWrappers_SparseFactor {
1314  PyObject_HEAD
1315  struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtab;
1316  superlu_options_t options;
1317  SuperMatrix A;
1318  SuperMatrix AC;
1319  SuperMatrix L;
1320  SuperMatrix U;
1321  SuperMatrix X;
1322  GlobalLU_t Glu;
1323  SuperLUStat_t stat;
1324  struct __pyx_t_15superluWrappers__NCformat storeA;
1325  struct __pyx_t_15superluWrappers__DNformat storeX;
1326  int *perm_c;
1327  int *perm_r;
1328  int *etree;
1329  unsigned int use_same_perm_c;
1330  unsigned int use_same_sparsity;
1331  int dim;
1332 };
1333 
1334 
1335 /* "View.MemoryView":105
1336  *
1337  * @cname("__pyx_array")
1338  * cdef class array: # <<<<<<<<<<<<<<
1339  *
1340  * cdef:
1341  */
1342 struct __pyx_array_obj {
1343  PyObject_HEAD
1344  struct __pyx_vtabstruct_array *__pyx_vtab;
1345  char *data;
1346  Py_ssize_t len;
1347  char *format;
1348  int ndim;
1349  Py_ssize_t *_shape;
1350  Py_ssize_t *_strides;
1351  Py_ssize_t itemsize;
1352  PyObject *mode;
1353  PyObject *_format;
1354  void (*callback_free_data)(void *);
1355  int free_data;
1356  int dtype_is_object;
1357 };
1358 
1359 
1360 /* "View.MemoryView":279
1361  *
1362  * @cname('__pyx_MemviewEnum')
1363  * cdef class Enum(object): # <<<<<<<<<<<<<<
1364  * cdef object name
1365  * def __init__(self, name):
1366  */
1367 struct __pyx_MemviewEnum_obj {
1368  PyObject_HEAD
1369  PyObject *name;
1370 };
1371 
1372 
1373 /* "View.MemoryView":330
1374  *
1375  * @cname('__pyx_memoryview')
1376  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1377  *
1378  * cdef object obj
1379  */
1380 struct __pyx_memoryview_obj {
1381  PyObject_HEAD
1382  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1383  PyObject *obj;
1384  PyObject *_size;
1385  PyObject *_array_interface;
1386  PyThread_type_lock lock;
1387  __pyx_atomic_int acquisition_count[2];
1388  __pyx_atomic_int *acquisition_count_aligned_p;
1389  Py_buffer view;
1390  int flags;
1391  int dtype_is_object;
1392  __Pyx_TypeInfo *typeinfo;
1393 };
1394 
1395 
1396 /* "View.MemoryView":965
1397  *
1398  * @cname('__pyx_memoryviewslice')
1399  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1400  * "Internal class for passing memoryview slices to Python"
1401  *
1402  */
1403 struct __pyx_memoryviewslice_obj {
1404  struct __pyx_memoryview_obj __pyx_base;
1405  __Pyx_memviewslice from_slice;
1406  PyObject *from_object;
1407  PyObject *(*to_object_func)(char *);
1408  int (*to_dtype_func)(char *, PyObject *);
1409 };
1410 
1411 
1412 
1413 /* "superluWrappers.pyx":145
1414  * np.int32_t * colend
1415  *
1416  * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
1417  *
1418  * cdef _superlu_options_t options
1419  */
1420 
1421 struct __pyx_vtabstruct_15superluWrappers_SparseFactor {
1422  PyObject *(*_set_mat_types)(struct __pyx_obj_15superluWrappers_SparseFactor *);
1423 };
1424 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtabptr_15superluWrappers_SparseFactor;
1425 
1426 
1427 /* "View.MemoryView":105
1428  *
1429  * @cname("__pyx_array")
1430  * cdef class array: # <<<<<<<<<<<<<<
1431  *
1432  * cdef:
1433  */
1434 
1435 struct __pyx_vtabstruct_array {
1436  PyObject *(*get_memview)(struct __pyx_array_obj *);
1437 };
1438 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1439 
1440 
1441 /* "View.MemoryView":330
1442  *
1443  * @cname('__pyx_memoryview')
1444  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1445  *
1446  * cdef object obj
1447  */
1448 
1449 struct __pyx_vtabstruct_memoryview {
1450  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1451  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1452  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1453  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1454  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1455  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1456  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1457 };
1458 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1459 
1460 
1461 /* "View.MemoryView":965
1462  *
1463  * @cname('__pyx_memoryviewslice')
1464  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1465  * "Internal class for passing memoryview slices to Python"
1466  *
1467  */
1468 
1469 struct __pyx_vtabstruct__memoryviewslice {
1470  struct __pyx_vtabstruct_memoryview __pyx_base;
1471 };
1472 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1473 
1474 /* --- Runtime support code (head) --- */
1475 /* Refnanny.proto */
1476 #ifndef CYTHON_REFNANNY
1477  #define CYTHON_REFNANNY 0
1478 #endif
1479 #if CYTHON_REFNANNY
1480  typedef struct {
1481  void (*INCREF)(void*, PyObject*, int);
1482  void (*DECREF)(void*, PyObject*, int);
1483  void (*GOTREF)(void*, PyObject*, int);
1484  void (*GIVEREF)(void*, PyObject*, int);
1485  void* (*SetupContext)(const char*, int, const char*);
1486  void (*FinishContext)(void**);
1487  } __Pyx_RefNannyAPIStruct;
1488  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1489  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1490  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1491 #ifdef WITH_THREAD
1492  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1493  if (acquire_gil) {\
1494  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1495  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1496  PyGILState_Release(__pyx_gilstate_save);\
1497  } else {\
1498  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1499  }
1500 #else
1501  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1502  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1503 #endif
1504  #define __Pyx_RefNannyFinishContext()\
1505  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1506  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1507  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1508  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1509  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1510  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1511  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1512  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1513  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1514 #else
1515  #define __Pyx_RefNannyDeclarations
1516  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1517  #define __Pyx_RefNannyFinishContext()
1518  #define __Pyx_INCREF(r) Py_INCREF(r)
1519  #define __Pyx_DECREF(r) Py_DECREF(r)
1520  #define __Pyx_GOTREF(r)
1521  #define __Pyx_GIVEREF(r)
1522  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1523  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1524  #define __Pyx_XGOTREF(r)
1525  #define __Pyx_XGIVEREF(r)
1526 #endif
1527 #define __Pyx_XDECREF_SET(r, v) do {\
1528  PyObject *tmp = (PyObject *) r;\
1529  r = v; __Pyx_XDECREF(tmp);\
1530  } while (0)
1531 #define __Pyx_DECREF_SET(r, v) do {\
1532  PyObject *tmp = (PyObject *) r;\
1533  r = v; __Pyx_DECREF(tmp);\
1534  } while (0)
1535 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1536 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1537 
1538 /* PyObjectGetAttrStr.proto */
1539 #if CYTHON_USE_TYPE_SLOTS
1540 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1541 #else
1542 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1543 #endif
1544 
1545 /* GetBuiltinName.proto */
1546 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1547 
1548 /* RaiseArgTupleInvalid.proto */
1549 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1550  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1551 
1552 /* RaiseDoubleKeywords.proto */
1553 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1554 
1555 /* ParseKeywords.proto */
1556 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1557  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1558  const char* function_name);
1559 
1560 /* PyObjectSetAttrStr.proto */
1561 #if CYTHON_USE_TYPE_SLOTS
1562 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1563 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1564 #else
1565 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1566 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1567 #endif
1568 
1569 /* PyObjectCall.proto */
1570 #if CYTHON_COMPILING_IN_CPYTHON
1571 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1572 #else
1573 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1574 #endif
1575 
1576 /* ExtTypeTest.proto */
1577 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1578 
1579 /* MemviewSliceInit.proto */
1580 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1581 #define __Pyx_MEMVIEW_DIRECT 1
1582 #define __Pyx_MEMVIEW_PTR 2
1583 #define __Pyx_MEMVIEW_FULL 4
1584 #define __Pyx_MEMVIEW_CONTIG 8
1585 #define __Pyx_MEMVIEW_STRIDED 16
1586 #define __Pyx_MEMVIEW_FOLLOW 32
1587 #define __Pyx_IS_C_CONTIG 1
1588 #define __Pyx_IS_F_CONTIG 2
1589 static int __Pyx_init_memviewslice(
1590  struct __pyx_memoryview_obj *memview,
1591  int ndim,
1592  __Pyx_memviewslice *memviewslice,
1593  int memview_is_new_reference);
1594 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1595  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1596 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1597  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1598 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1599 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1600 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1601 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1602 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1603 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1604 
1605 /* PyObjectLookupSpecial.proto */
1606 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1607 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
1608  PyObject *res;
1609  PyTypeObject *tp = Py_TYPE(obj);
1610 #if PY_MAJOR_VERSION < 3
1611  if (unlikely(PyInstance_Check(obj)))
1612  return __Pyx_PyObject_GetAttrStr(obj, attr_name);
1613 #endif
1614  res = _PyType_Lookup(tp, attr_name);
1615  if (likely(res)) {
1616  descrgetfunc f = Py_TYPE(res)->tp_descr_get;
1617  if (!f) {
1618  Py_INCREF(res);
1619  } else {
1620  res = f(res, obj, (PyObject *)tp);
1621  }
1622  } else {
1623  PyErr_SetObject(PyExc_AttributeError, attr_name);
1624  }
1625  return res;
1626 }
1627 #else
1628 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
1629 #endif
1630 
1631 /* PyFunctionFastCall.proto */
1632 #if CYTHON_FAST_PYCALL
1633 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1634  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1635 #if 1 || PY_VERSION_HEX < 0x030600B1
1636 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1637 #else
1638 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1639 #endif
1640 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1641  (sizeof(char [1 - 2*!(cond)]) - 1)
1642 #ifndef Py_MEMBER_SIZE
1643 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1644 #endif
1645  static size_t __pyx_pyframe_localsplus_offset = 0;
1646  #include "frameobject.h"
1647  #define __Pxy_PyFrame_Initialize_Offsets()\
1648  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1649  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1650  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1651  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1652 #endif
1653 
1654 /* PyObjectCallMethO.proto */
1655 #if CYTHON_COMPILING_IN_CPYTHON
1656 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1657 #endif
1658 
1659 /* PyObjectCallNoArg.proto */
1660 #if CYTHON_COMPILING_IN_CPYTHON
1661 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1662 #else
1663 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1664 #endif
1665 
1666 /* PyCFunctionFastCall.proto */
1667 #if CYTHON_FAST_PYCCALL
1668 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1669 #else
1670 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1671 #endif
1672 
1673 /* PyObjectCallOneArg.proto */
1674 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1675 
1676 /* GetItemInt.proto */
1677 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1678  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1679  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1680  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1681  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1682 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1683  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1684  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1685  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1686 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1687  int wraparound, int boundscheck);
1688 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1689  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1690  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1691  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1692 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1693  int wraparound, int boundscheck);
1694 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1695 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1696  int is_list, int wraparound, int boundscheck);
1697 
1698 /* ObjectGetItem.proto */
1699 #if CYTHON_USE_TYPE_SLOTS
1700 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1701 #else
1702 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1703 #endif
1704 
1705 /* PyObjectCall2Args.proto */
1706 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1707 
1708 /* PyIntBinop.proto */
1709 #if !CYTHON_COMPILING_IN_PYPY
1710 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1711 #else
1712 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1713  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1714 #endif
1715 
1716 /* GetTopmostException.proto */
1717 #if CYTHON_USE_EXC_INFO_STACK
1718 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1719 #endif
1720 
1721 /* PyThreadStateGet.proto */
1722 #if CYTHON_FAST_THREAD_STATE
1723 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1724 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1725 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1726 #else
1727 #define __Pyx_PyThreadState_declare
1728 #define __Pyx_PyThreadState_assign
1729 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1730 #endif
1731 
1732 /* SaveResetException.proto */
1733 #if CYTHON_FAST_THREAD_STATE
1734 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1735 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1736 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1737 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1738 #else
1739 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1740 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1741 #endif
1742 
1743 /* GetException.proto */
1744 #if CYTHON_FAST_THREAD_STATE
1745 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1746 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1747 #else
1748 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1749 #endif
1750 
1751 /* PyErrFetchRestore.proto */
1752 #if CYTHON_FAST_THREAD_STATE
1753 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1754 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1755 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1756 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1757 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1758 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1759 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1760 #if CYTHON_COMPILING_IN_CPYTHON
1761 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1762 #else
1763 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1764 #endif
1765 #else
1766 #define __Pyx_PyErr_Clear() PyErr_Clear()
1767 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1768 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1769 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1770 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1771 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1772 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1773 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1774 #endif
1775 
1776 /* SliceObject.proto */
1777 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1778  PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1779  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1780  int has_cstart, int has_cstop, int wraparound);
1781 
1782 /* RaiseException.proto */
1783 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1784 
1785 /* WriteUnraisableException.proto */
1786 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1787  int lineno, const char *filename,
1788  int full_traceback, int nogil);
1789 
1790 /* PyErrExceptionMatches.proto */
1791 #if CYTHON_FAST_THREAD_STATE
1792 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1793 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1794 #else
1795 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1796 #endif
1797 
1798 /* ArgTypeTest.proto */
1799 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1800  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1801  __Pyx__ArgTypeTest(obj, type, name, exact))
1802 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1803 
1804 /* IncludeStringH.proto */
1805 #include <string.h>
1806 
1807 /* BytesEquals.proto */
1808 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1809 
1810 /* UnicodeEquals.proto */
1811 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1812 
1813 /* StrEquals.proto */
1814 #if PY_MAJOR_VERSION >= 3
1815 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1816 #else
1817 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1818 #endif
1819 
1820 /* None.proto */
1821 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1822 
1823 /* UnaryNegOverflows.proto */
1824 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1825  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1826 
1827 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1828 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1829 /* GetAttr.proto */
1830 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1831 
1832 /* decode_c_string_utf16.proto */
1833 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1834  int byteorder = 0;
1835  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1836 }
1837 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1838  int byteorder = -1;
1839  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1840 }
1841 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1842  int byteorder = 1;
1843  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1844 }
1845 
1846 /* decode_c_string.proto */
1847 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1848  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1849  const char* encoding, const char* errors,
1850  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1851 
1852 /* GetAttr3.proto */
1853 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1854 
1855 /* PyDictVersioning.proto */
1856 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1857 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1858 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1859 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1860  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1861  (cache_var) = (value);
1862 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1863  static PY_UINT64_T __pyx_dict_version = 0;\
1864  static PyObject *__pyx_dict_cached_value = NULL;\
1865  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1866  (VAR) = __pyx_dict_cached_value;\
1867  } else {\
1868  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1869  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1870  }\
1871 }
1872 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1873 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1874 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1875 #else
1876 #define __PYX_GET_DICT_VERSION(dict) (0)
1877 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1878 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1879 #endif
1880 
1881 /* GetModuleGlobalName.proto */
1882 #if CYTHON_USE_DICT_VERSIONS
1883 #define __Pyx_GetModuleGlobalName(var, name) {\
1884  static PY_UINT64_T __pyx_dict_version = 0;\
1885  static PyObject *__pyx_dict_cached_value = NULL;\
1886  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1887  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1888  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1889 }
1890 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1891  PY_UINT64_T __pyx_dict_version;\
1892  PyObject *__pyx_dict_cached_value;\
1893  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1894 }
1895 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1896 #else
1897 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1898 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1899 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1900 #endif
1901 
1902 /* RaiseTooManyValuesToUnpack.proto */
1903 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1904 
1905 /* RaiseNeedMoreValuesToUnpack.proto */
1906 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1907 
1908 /* RaiseNoneIterError.proto */
1909 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1910 
1911 /* SwapException.proto */
1912 #if CYTHON_FAST_THREAD_STATE
1913 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1914 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1915 #else
1916 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1917 #endif
1918 
1919 /* Import.proto */
1920 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1921 
1922 /* FastTypeChecks.proto */
1923 #if CYTHON_COMPILING_IN_CPYTHON
1924 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1925 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1926 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1927 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1928 #else
1929 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1930 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1931 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1932 #endif
1933 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1934 
1935 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1936 /* ListCompAppend.proto */
1937 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1938 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1939  PyListObject* L = (PyListObject*) list;
1940  Py_ssize_t len = Py_SIZE(list);
1941  if (likely(L->allocated > len)) {
1942  Py_INCREF(x);
1943  PyList_SET_ITEM(list, len, x);
1944  __Pyx_SET_SIZE(list, len + 1);
1945  return 0;
1946  }
1947  return PyList_Append(list, x);
1948 }
1949 #else
1950 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1951 #endif
1952 
1953 /* ListExtend.proto */
1954 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1955 #if CYTHON_COMPILING_IN_CPYTHON
1956  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1957  if (unlikely(!none))
1958  return -1;
1959  Py_DECREF(none);
1960  return 0;
1961 #else
1962  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1963 #endif
1964 }
1965 
1966 /* ListAppend.proto */
1967 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1968 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1969  PyListObject* L = (PyListObject*) list;
1970  Py_ssize_t len = Py_SIZE(list);
1971  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1972  Py_INCREF(x);
1973  PyList_SET_ITEM(list, len, x);
1974  __Pyx_SET_SIZE(list, len + 1);
1975  return 0;
1976  }
1977  return PyList_Append(list, x);
1978 }
1979 #else
1980 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1981 #endif
1982 
1983 /* None.proto */
1984 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1985 
1986 /* None.proto */
1987 static CYTHON_INLINE long __Pyx_div_long(long, long);
1988 
1989 /* ImportFrom.proto */
1990 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1991 
1992 /* HasAttr.proto */
1993 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1994 
1995 /* PyObject_GenericGetAttrNoDict.proto */
1996 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1997 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1998 #else
1999 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2000 #endif
2001 
2002 /* PyObject_GenericGetAttr.proto */
2003 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2004 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2005 #else
2006 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2007 #endif
2008 
2009 /* PyObjectGetAttrStrNoError.proto */
2010 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2011 
2012 /* SetupReduce.proto */
2013 static int __Pyx_setup_reduce(PyObject* type_obj);
2014 
2015 /* SetVTable.proto */
2016 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2017 
2018 /* TypeImport.proto */
2019 #ifndef __PYX_HAVE_RT_ImportType_proto
2020 #define __PYX_HAVE_RT_ImportType_proto
2021 enum __Pyx_ImportType_CheckSize {
2022  __Pyx_ImportType_CheckSize_Error = 0,
2023  __Pyx_ImportType_CheckSize_Warn = 1,
2024  __Pyx_ImportType_CheckSize_Ignore = 2
2025 };
2026 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2027 #endif
2028 
2029 /* CalculateMetaclass.proto */
2030 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2031 
2032 /* FetchCommonType.proto */
2033 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2034 
2035 /* CythonFunctionShared.proto */
2036 #define __Pyx_CyFunction_USED 1
2037 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2038 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2039 #define __Pyx_CYFUNCTION_CCLASS 0x04
2040 #define __Pyx_CyFunction_GetClosure(f)\
2041  (((__pyx_CyFunctionObject *) (f))->func_closure)
2042 #define __Pyx_CyFunction_GetClassObj(f)\
2043  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2044 #define __Pyx_CyFunction_Defaults(type, f)\
2045  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2046 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2047  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2048 typedef struct {
2049  PyCFunctionObject func;
2050 #if PY_VERSION_HEX < 0x030500A0
2051  PyObject *func_weakreflist;
2052 #endif
2053  PyObject *func_dict;
2054  PyObject *func_name;
2055  PyObject *func_qualname;
2056  PyObject *func_doc;
2057  PyObject *func_globals;
2058  PyObject *func_code;
2059  PyObject *func_closure;
2060  PyObject *func_classobj;
2061  void *defaults;
2062  int defaults_pyobjects;
2063  size_t defaults_size; // used by FusedFunction for copying defaults
2064  int flags;
2065  PyObject *defaults_tuple;
2066  PyObject *defaults_kwdict;
2067  PyObject *(*defaults_getter)(PyObject *);
2068  PyObject *func_annotations;
2069 } __pyx_CyFunctionObject;
2070 static PyTypeObject *__pyx_CyFunctionType = 0;
2071 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2072 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2073  int flags, PyObject* qualname,
2074  PyObject *self,
2075  PyObject *module, PyObject *globals,
2076  PyObject* code);
2077 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2078  size_t size,
2079  int pyobjects);
2080 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2081  PyObject *tuple);
2082 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2083  PyObject *dict);
2084 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2085  PyObject *dict);
2086 static int __pyx_CyFunction_init(void);
2087 
2088 /* CythonFunction.proto */
2089 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2090  int flags, PyObject* qualname,
2091  PyObject *closure,
2092  PyObject *module, PyObject *globals,
2093  PyObject* code);
2094 
2095 /* SetNameInClass.proto */
2096 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2097 #define __Pyx_SetNameInClass(ns, name, value)\
2098  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2099 #elif CYTHON_COMPILING_IN_CPYTHON
2100 #define __Pyx_SetNameInClass(ns, name, value)\
2101  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2102 #else
2103 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2104 #endif
2105 
2106 /* Py3ClassCreate.proto */
2107 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2108  PyObject *mkw, PyObject *modname, PyObject *doc);
2109 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2110  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2111 
2112 /* CLineInTraceback.proto */
2113 #ifdef CYTHON_CLINE_IN_TRACEBACK
2114 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2115 #else
2116 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2117 #endif
2118 
2119 /* CodeObjectCache.proto */
2120 typedef struct {
2121  PyCodeObject* code_object;
2122  int code_line;
2123 } __Pyx_CodeObjectCacheEntry;
2124 struct __Pyx_CodeObjectCache {
2125  int count;
2126  int max_count;
2127  __Pyx_CodeObjectCacheEntry* entries;
2128 };
2129 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2130 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2131 static PyCodeObject *__pyx_find_code_object(int code_line);
2132 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2133 
2134 /* AddTraceback.proto */
2135 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2136  int py_line, const char *filename);
2137 
2138 #if PY_MAJOR_VERSION < 3
2139  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2140  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2141 #else
2142  #define __Pyx_GetBuffer PyObject_GetBuffer
2143  #define __Pyx_ReleaseBuffer PyBuffer_Release
2144 #endif
2145 
2146 
2147 /* BufferStructDeclare.proto */
2148 typedef struct {
2149  Py_ssize_t shape, strides, suboffsets;
2150 } __Pyx_Buf_DimInfo;
2151 typedef struct {
2152  size_t refcount;
2153  Py_buffer pybuffer;
2154 } __Pyx_Buffer;
2155 typedef struct {
2156  __Pyx_Buffer *rcbuffer;
2157  char *data;
2158  __Pyx_Buf_DimInfo diminfo[8];
2159 } __Pyx_LocalBuf_ND;
2160 
2161 /* MemviewSliceIsContig.proto */
2162 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2163 
2164 /* OverlappingSlices.proto */
2165 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2166  __Pyx_memviewslice *slice2,
2167  int ndim, size_t itemsize);
2168 
2169 /* Capsule.proto */
2170 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2171 
2172 /* GCCDiagnostics.proto */
2173 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2174 #define __Pyx_HAS_GCC_DIAGNOSTIC
2175 #endif
2176 
2177 /* IsLittleEndian.proto */
2178 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2179 
2180 /* BufferFormatCheck.proto */
2181 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2182 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2183  __Pyx_BufFmt_StackElem* stack,
2184  __Pyx_TypeInfo* type);
2185 
2186 /* TypeInfoCompare.proto */
2187 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2188 
2189 /* MemviewSliceValidateAndInit.proto */
2190 static int __Pyx_ValidateAndInit_memviewslice(
2191  int *axes_specs,
2192  int c_or_f_flag,
2193  int buf_flags,
2194  int ndim,
2195  __Pyx_TypeInfo *dtype,
2196  __Pyx_BufFmt_StackElem stack[],
2197  __Pyx_memviewslice *memviewslice,
2198  PyObject *original_obj);
2199 
2200 /* ObjectToMemviewSlice.proto */
2201 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
2202 
2203 /* ObjectToMemviewSlice.proto */
2204 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *, int writable_flag);
2205 
2206 /* RealImag.proto */
2207 #if CYTHON_CCOMPLEX
2208  #ifdef __cplusplus
2209  #define __Pyx_CREAL(z) ((z).real())
2210  #define __Pyx_CIMAG(z) ((z).imag())
2211  #else
2212  #define __Pyx_CREAL(z) (__real__(z))
2213  #define __Pyx_CIMAG(z) (__imag__(z))
2214  #endif
2215 #else
2216  #define __Pyx_CREAL(z) ((z).real)
2217  #define __Pyx_CIMAG(z) ((z).imag)
2218 #endif
2219 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2220  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2221  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2222  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2223 #else
2224  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2225  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2226 #endif
2227 
2228 /* Arithmetic.proto */
2229 #if CYTHON_CCOMPLEX
2230  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2231  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2232  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2233  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2234  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2235  #define __Pyx_c_neg_float(a) (-(a))
2236  #ifdef __cplusplus
2237  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2238  #define __Pyx_c_conj_float(z) (::std::conj(z))
2239  #if 1
2240  #define __Pyx_c_abs_float(z) (::std::abs(z))
2241  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2242  #endif
2243  #else
2244  #define __Pyx_c_is_zero_float(z) ((z)==0)
2245  #define __Pyx_c_conj_float(z) (conjf(z))
2246  #if 1
2247  #define __Pyx_c_abs_float(z) (cabsf(z))
2248  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2249  #endif
2250  #endif
2251 #else
2252  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2253  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2254  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2255  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2256  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2257  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2258  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2259  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2260  #if 1
2261  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2262  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2263  #endif
2264 #endif
2265 
2266 /* Arithmetic.proto */
2267 #if CYTHON_CCOMPLEX
2268  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2269  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2270  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2271  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2272  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2273  #define __Pyx_c_neg_double(a) (-(a))
2274  #ifdef __cplusplus
2275  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2276  #define __Pyx_c_conj_double(z) (::std::conj(z))
2277  #if 1
2278  #define __Pyx_c_abs_double(z) (::std::abs(z))
2279  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2280  #endif
2281  #else
2282  #define __Pyx_c_is_zero_double(z) ((z)==0)
2283  #define __Pyx_c_conj_double(z) (conj(z))
2284  #if 1
2285  #define __Pyx_c_abs_double(z) (cabs(z))
2286  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2287  #endif
2288  #endif
2289 #else
2290  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2291  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2292  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2293  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2294  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2295  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2296  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2297  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2298  #if 1
2299  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2300  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2301  #endif
2302 #endif
2303 
2304 /* MemviewSliceCopyTemplate.proto */
2305 static __Pyx_memviewslice
2306 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2307  const char *mode, int ndim,
2308  size_t sizeof_dtype, int contig_flag,
2309  int dtype_is_object);
2310 
2311 /* CIntFromPy.proto */
2312 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2313 
2314 /* CIntToPy.proto */
2315 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
2316 
2317 /* CIntFromPy.proto */
2318 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
2319 
2320 /* CIntFromPy.proto */
2321 static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
2322 
2323 /* CIntToPy.proto */
2324 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2325 
2326 /* CIntFromPy.proto */
2327 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2328 
2329 /* CIntToPy.proto */
2330 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2331 
2332 /* CIntFromPy.proto */
2333 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2334 
2335 /* CheckBinaryVersion.proto */
2336 static int __Pyx_check_binary_version(void);
2337 
2338 /* InitStrings.proto */
2339 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2340 
2341 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto*/
2342 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2343 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2344 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2345 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2346 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2347 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2348 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2349 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2350 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2351 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2352 
2353 /* Module declarations from 'cpython.buffer' */
2354 
2355 /* Module declarations from 'libc.string' */
2356 
2357 /* Module declarations from 'libc.stdio' */
2358 
2359 /* Module declarations from '__builtin__' */
2360 
2361 /* Module declarations from 'cpython.type' */
2362 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2363 
2364 /* Module declarations from 'cpython' */
2365 
2366 /* Module declarations from 'cpython.object' */
2367 
2368 /* Module declarations from 'cpython.ref' */
2369 
2370 /* Module declarations from 'cpython.mem' */
2371 
2372 /* Module declarations from 'numpy' */
2373 
2374 /* Module declarations from 'numpy' */
2375 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2376 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2377 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2378 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2379 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2380 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2381 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2382 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2383 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2384 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2385 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2386 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2387 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2388 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2389 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2390 
2391 /* Module declarations from 'cython.view' */
2392 
2393 /* Module declarations from 'cython' */
2394 
2395 /* Module declarations from 'libc.stdlib' */
2396 
2397 /* Module declarations from 'superluWrappers' */
2398 static PyTypeObject *__pyx_ptype_15superluWrappers_cSparseMatrix = 0;
2399 static PyTypeObject *__pyx_ptype_15superluWrappers_SparseFactor = 0;
2400 static PyTypeObject *__pyx_array_type = 0;
2401 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2402 static PyTypeObject *__pyx_memoryview_type = 0;
2403 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2404 static PyObject *generic = 0;
2405 static PyObject *strided = 0;
2406 static PyObject *indirect = 0;
2407 static PyObject *contiguous = 0;
2408 static PyObject *indirect_contiguous = 0;
2409 static int __pyx_memoryview_thread_locks_used;
2410 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2411 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(struct __pyx_obj_15superluWrappers_cSparseMatrix *, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2412 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(struct __pyx_obj_15superluWrappers_cSparseMatrix *, struct __pyx_obj_15superluWrappers_SparseFactor *); /*proto*/
2413 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(struct __pyx_obj_15superluWrappers_SparseFactor *, __Pyx_memviewslice); /*proto*/
2414 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2415 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2416 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2417 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2418 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2419 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2420 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2421 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2422 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2423 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2424 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2425 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2426 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2427 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2428 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2429 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2430 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2431 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2432 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2433 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2434 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2435 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2436 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2437 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2438 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2439 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2440 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2441 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2442 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2443 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2444 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2445 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2446 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2447 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
2448 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
2449 #define __Pyx_MODULE_NAME "superluWrappers"
2450 extern int __pyx_module_is_main_superluWrappers;
2451 int __pyx_module_is_main_superluWrappers = 0;
2452 
2453 /* Implementation of 'superluWrappers' */
2454 static PyObject *__pyx_builtin_object;
2455 static PyObject *__pyx_builtin_open;
2456 static PyObject *__pyx_builtin_range;
2457 static PyObject *__pyx_builtin_TypeError;
2458 static PyObject *__pyx_builtin_ImportError;
2459 static PyObject *__pyx_builtin_ValueError;
2460 static PyObject *__pyx_builtin_MemoryError;
2461 static PyObject *__pyx_builtin_enumerate;
2462 static PyObject *__pyx_builtin_Ellipsis;
2463 static PyObject *__pyx_builtin_id;
2464 static PyObject *__pyx_builtin_IndexError;
2465 static const char __pyx_k_O[] = "O";
2466 static const char __pyx_k_c[] = "c";
2467 static const char __pyx_k_i[] = "i";
2468 static const char __pyx_k_k[] = "k";
2469 static const char __pyx_k_w[] = "w";
2470 static const char __pyx_k_x[] = "x";
2471 static const char __pyx_k_y[] = "y";
2472 static const char __pyx_k_id[] = "id";
2473 static const char __pyx_k_nc[] = "nc";
2474 static const char __pyx_k_np[] = "np";
2475 static const char __pyx_k_nr[] = "nr";
2476 static const char __pyx_k_dim[] = "dim";
2477 static const char __pyx_k_doc[] = "__doc__";
2478 static const char __pyx_k_new[] = "__new__";
2479 static const char __pyx_k_nnz[] = "nnz";
2480 static const char __pyx_k_obj[] = "obj";
2481 static const char __pyx_k_base[] = "base";
2482 static const char __pyx_k_dict[] = "__dict__";
2483 static const char __pyx_k_exit[] = "__exit__";
2484 static const char __pyx_k_init[] = "__init__";
2485 static const char __pyx_k_main[] = "__main__";
2486 static const char __pyx_k_mode[] = "mode";
2487 static const char __pyx_k_name[] = "name";
2488 static const char __pyx_k_ndim[] = "ndim";
2489 static const char __pyx_k_open[] = "open";
2490 static const char __pyx_k_pack[] = "pack";
2491 static const char __pyx_k_rows[] = "_rows";
2492 static const char __pyx_k_self[] = "self";
2493 static const char __pyx_k_size[] = "size";
2494 static const char __pyx_k_step[] = "step";
2495 static const char __pyx_k_stop[] = "stop";
2496 static const char __pyx_k_test[] = "__test__";
2497 static const char __pyx_k_ASCII[] = "ASCII";
2498 static const char __pyx_k_class[] = "__class__";
2499 static const char __pyx_k_enter[] = "__enter__";
2500 static const char __pyx_k_error[] = "error";
2501 static const char __pyx_k_flags[] = "flags";
2502 static const char __pyx_k_i_i_i[] = "%i %i %i \n";
2503 static const char __pyx_k_numpy[] = "numpy";
2504 static const char __pyx_k_nzval[] = "nzval";
2505 static const char __pyx_k_range[] = "range";
2506 static const char __pyx_k_shape[] = "shape";
2507 static const char __pyx_k_start[] = "start";
2508 static const char __pyx_k_write[] = "write";
2509 static const char __pyx_k_colind[] = "colind";
2510 static const char __pyx_k_encode[] = "encode";
2511 static const char __pyx_k_format[] = "format";
2512 static const char __pyx_k_fwrite[] = "fwrite";
2513 static const char __pyx_k_import[] = "__import__";
2514 static const char __pyx_k_matvec[] = "matvec";
2515 static const char __pyx_k_module[] = "__module__";
2516 static const char __pyx_k_name_2[] = "__name__";
2517 static const char __pyx_k_nzvals[] = "nzvals";
2518 static const char __pyx_k_object[] = "object";
2519 static const char __pyx_k_pickle[] = "pickle";
2520 static const char __pyx_k_reduce[] = "__reduce__";
2521 static const char __pyx_k_rowptr[] = "rowptr";
2522 static const char __pyx_k_struct[] = "struct";
2523 static const char __pyx_k_unpack[] = "unpack";
2524 static const char __pyx_k_update[] = "update";
2525 static const char __pyx_k_fortran[] = "fortran";
2526 static const char __pyx_k_memview[] = "memview";
2527 static const char __pyx_k_prepare[] = "__prepare__";
2528 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2529 static const char __pyx_k_filename[] = "filename";
2530 static const char __pyx_k_getstate[] = "__getstate__";
2531 static const char __pyx_k_itemsize[] = "itemsize";
2532 static const char __pyx_k_pyx_type[] = "__pyx_type";
2533 static const char __pyx_k_qualname[] = "__qualname__";
2534 static const char __pyx_k_setstate[] = "__setstate__";
2535 static const char __pyx_k_TypeError[] = "TypeError";
2536 static const char __pyx_k_d_d_13_8e[] = "%d %d %13.8e\n";
2537 static const char __pyx_k_enumerate[] = "enumerate";
2538 static const char __pyx_k_metaclass[] = "__metaclass__";
2539 static const char __pyx_k_pyx_state[] = "__pyx_state";
2540 static const char __pyx_k_range_end[] = "range_end";
2541 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2542 static const char __pyx_k_IndexError[] = "IndexError";
2543 static const char __pyx_k_ValueError[] = "ValueError";
2544 static const char __pyx_k_pyx_result[] = "__pyx_result";
2545 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2546 static const char __pyx_k_ImportError[] = "ImportError";
2547 static const char __pyx_k_MemoryError[] = "MemoryError";
2548 static const char __pyx_k_PickleError[] = "PickleError";
2549 static const char __pyx_k_output_file[] = "output_file";
2550 static const char __pyx_k_range_start[] = "range_start";
2551 static const char __pyx_k_SparseFactor[] = "SparseFactor";
2552 static const char __pyx_k_SparseMatrix[] = "SparseMatrix";
2553 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2554 static const char __pyx_k_sparseFactor[] = "sparseFactor";
2555 static const char __pyx_k_stringsource[] = "stringsource";
2556 static const char __pyx_k_cSparseMatrix[] = "_cSparseMatrix";
2557 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2558 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2559 static const char __pyx_k_sparse_matrix[] = "sparse_matrix";
2560 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2561 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2562 static const char __pyx_k_cSparseMatrix_2[] = "cSparseMatrix";
2563 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2564 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2565 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2566 static const char __pyx_k_superluWrappers[] = "superluWrappers";
2567 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2568 static const char __pyx_k_sparseFactorSolve[] = "sparseFactorSolve";
2569 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2570 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2571 static const char __pyx_k_SparseMatrix___init[] = "SparseMatrix.__init__";
2572 static const char __pyx_k_SparseMatrix_fwrite[] = "SparseMatrix.fwrite";
2573 static const char __pyx_k_SparseMatrix_matvec[] = "SparseMatrix.matvec";
2574 static const char __pyx_k_sparseFactorPrepare[] = "sparseFactorPrepare";
2575 static const char __pyx_k_getCSRrepresentation[] = "getCSRrepresentation";
2576 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2577 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2578 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2579 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2580 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2581 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2582 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2583 static const char __pyx_k_getSubMatCSRrepresentation[] = "getSubMatCSRrepresentation";
2584 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2585 static const char __pyx_k_proteus_superluWrappers_pyx[] = "proteus/superluWrappers.pyx";
2586 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2587 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2588 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2589 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2590 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2591 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2592 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2593 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2594 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2595 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2596 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2597 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2598 static const char __pyx_k_SparseMatrix_getCSRrepresentatio[] = "SparseMatrix.getCSRrepresentation";
2599 static const char __pyx_k_SparseMatrix_getSubMatCSRreprese[] = "SparseMatrix.getSubMatCSRrepresentation";
2600 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2601 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2602 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2603 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2604 static const char __pyx_k_self_A_self_AC_self_L_self_U_sel[] = "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling";
2605 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2606 static PyObject *__pyx_n_s_ASCII;
2607 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2608 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2609 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2610 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2611 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2612 static PyObject *__pyx_n_s_Ellipsis;
2613 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2614 static PyObject *__pyx_n_s_ImportError;
2615 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2616 static PyObject *__pyx_n_s_IndexError;
2617 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2618 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2619 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2620 static PyObject *__pyx_n_s_MemoryError;
2621 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2622 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2623 static PyObject *__pyx_n_b_O;
2624 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2625 static PyObject *__pyx_n_s_PickleError;
2626 static PyObject *__pyx_n_s_SparseFactor;
2627 static PyObject *__pyx_n_s_SparseMatrix;
2628 static PyObject *__pyx_n_s_SparseMatrix___init;
2629 static PyObject *__pyx_n_s_SparseMatrix_fwrite;
2630 static PyObject *__pyx_n_s_SparseMatrix_getCSRrepresentatio;
2631 static PyObject *__pyx_n_s_SparseMatrix_getSubMatCSRreprese;
2632 static PyObject *__pyx_n_s_SparseMatrix_matvec;
2633 static PyObject *__pyx_n_s_TypeError;
2634 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2635 static PyObject *__pyx_n_s_ValueError;
2636 static PyObject *__pyx_n_s_View_MemoryView;
2637 static PyObject *__pyx_n_s_allocate_buffer;
2638 static PyObject *__pyx_n_s_base;
2639 static PyObject *__pyx_n_s_c;
2640 static PyObject *__pyx_n_u_c;
2641 static PyObject *__pyx_n_s_cSparseMatrix;
2642 static PyObject *__pyx_n_s_cSparseMatrix_2;
2643 static PyObject *__pyx_n_s_class;
2644 static PyObject *__pyx_n_s_cline_in_traceback;
2645 static PyObject *__pyx_n_s_colind;
2646 static PyObject *__pyx_kp_s_contiguous_and_direct;
2647 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2648 static PyObject *__pyx_kp_s_d_d_13_8e;
2649 static PyObject *__pyx_n_s_dict;
2650 static PyObject *__pyx_n_s_dim;
2651 static PyObject *__pyx_n_s_doc;
2652 static PyObject *__pyx_n_s_dtype_is_object;
2653 static PyObject *__pyx_n_s_encode;
2654 static PyObject *__pyx_n_s_enter;
2655 static PyObject *__pyx_n_s_enumerate;
2656 static PyObject *__pyx_n_s_error;
2657 static PyObject *__pyx_n_s_exit;
2658 static PyObject *__pyx_n_s_filename;
2659 static PyObject *__pyx_n_s_flags;
2660 static PyObject *__pyx_n_s_format;
2661 static PyObject *__pyx_n_s_fortran;
2662 static PyObject *__pyx_n_u_fortran;
2663 static PyObject *__pyx_n_s_fwrite;
2664 static PyObject *__pyx_n_s_getCSRrepresentation;
2665 static PyObject *__pyx_n_s_getSubMatCSRrepresentation;
2666 static PyObject *__pyx_n_s_getstate;
2667 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2668 static PyObject *__pyx_n_s_i;
2669 static PyObject *__pyx_kp_s_i_i_i;
2670 static PyObject *__pyx_n_s_id;
2671 static PyObject *__pyx_n_s_import;
2672 static PyObject *__pyx_n_s_init;
2673 static PyObject *__pyx_n_s_itemsize;
2674 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2675 static PyObject *__pyx_n_s_k;
2676 static PyObject *__pyx_n_s_main;
2677 static PyObject *__pyx_n_s_matvec;
2678 static PyObject *__pyx_n_s_memview;
2679 static PyObject *__pyx_n_s_metaclass;
2680 static PyObject *__pyx_n_s_mode;
2681 static PyObject *__pyx_n_s_module;
2682 static PyObject *__pyx_n_s_name;
2683 static PyObject *__pyx_n_s_name_2;
2684 static PyObject *__pyx_n_s_nc;
2685 static PyObject *__pyx_n_s_ndim;
2686 static PyObject *__pyx_n_s_new;
2687 static PyObject *__pyx_n_s_nnz;
2688 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2689 static PyObject *__pyx_n_s_np;
2690 static PyObject *__pyx_n_s_nr;
2691 static PyObject *__pyx_n_s_numpy;
2692 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2693 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2694 static PyObject *__pyx_n_s_nzval;
2695 static PyObject *__pyx_n_s_nzvals;
2696 static PyObject *__pyx_n_s_obj;
2697 static PyObject *__pyx_n_s_object;
2698 static PyObject *__pyx_n_s_open;
2699 static PyObject *__pyx_n_s_output_file;
2700 static PyObject *__pyx_n_s_pack;
2701 static PyObject *__pyx_n_s_pickle;
2702 static PyObject *__pyx_n_s_prepare;
2703 static PyObject *__pyx_kp_s_proteus_superluWrappers_pyx;
2704 static PyObject *__pyx_n_s_pyx_PickleError;
2705 static PyObject *__pyx_n_s_pyx_checksum;
2706 static PyObject *__pyx_n_s_pyx_getbuffer;
2707 static PyObject *__pyx_n_s_pyx_result;
2708 static PyObject *__pyx_n_s_pyx_state;
2709 static PyObject *__pyx_n_s_pyx_type;
2710 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2711 static PyObject *__pyx_n_s_pyx_vtable;
2712 static PyObject *__pyx_n_s_qualname;
2713 static PyObject *__pyx_n_s_range;
2714 static PyObject *__pyx_n_s_range_end;
2715 static PyObject *__pyx_n_s_range_start;
2716 static PyObject *__pyx_n_s_reduce;
2717 static PyObject *__pyx_n_s_reduce_cython;
2718 static PyObject *__pyx_n_s_reduce_ex;
2719 static PyObject *__pyx_n_s_rowptr;
2720 static PyObject *__pyx_n_s_rows;
2721 static PyObject *__pyx_n_s_self;
2722 static PyObject *__pyx_kp_s_self_A_self_AC_self_L_self_U_sel;
2723 static PyObject *__pyx_n_s_setstate;
2724 static PyObject *__pyx_n_s_setstate_cython;
2725 static PyObject *__pyx_n_s_shape;
2726 static PyObject *__pyx_n_s_size;
2727 static PyObject *__pyx_n_s_sparseFactor;
2728 static PyObject *__pyx_n_s_sparseFactorPrepare;
2729 static PyObject *__pyx_n_s_sparseFactorSolve;
2730 static PyObject *__pyx_n_s_sparse_matrix;
2731 static PyObject *__pyx_n_s_start;
2732 static PyObject *__pyx_n_s_step;
2733 static PyObject *__pyx_n_s_stop;
2734 static PyObject *__pyx_kp_s_strided_and_direct;
2735 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2736 static PyObject *__pyx_kp_s_strided_and_indirect;
2737 static PyObject *__pyx_kp_s_stringsource;
2738 static PyObject *__pyx_n_s_struct;
2739 static PyObject *__pyx_n_s_superluWrappers;
2740 static PyObject *__pyx_n_s_test;
2741 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2742 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2743 static PyObject *__pyx_n_s_unpack;
2744 static PyObject *__pyx_n_s_update;
2745 static PyObject *__pyx_n_s_w;
2746 static PyObject *__pyx_n_s_write;
2747 static PyObject *__pyx_n_s_x;
2748 static PyObject *__pyx_n_s_y;
2749 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr); /* proto */
2750 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
2751 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base); /* proto */
2752 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
2753 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end); /* proto */
2754 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, int __pyx_v_nr, int __pyx_v_nc, int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr); /* proto */
2755 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self); /* proto */
2756 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2757 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
2758 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
2759 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2760 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
2761 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2762 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor); /* proto */
2763 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x); /* proto */
2764 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2765 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2766 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2767 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2768 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2769 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2770 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2771 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2772 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2773 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2774 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2775 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2776 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2777 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2778 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2779 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2780 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2781 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2782 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2783 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2784 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2785 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2786 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2787 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2788 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2789 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2790 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2791 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2792 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2793 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2794 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2795 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2796 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2797 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2798 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2799 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2800 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2801 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2802 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2803 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2804 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2805 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2806 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2807 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2808 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2809 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2810 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2811 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2812 static PyObject *__pyx_int_0;
2813 static PyObject *__pyx_int_1;
2814 static PyObject *__pyx_int_184977713;
2815 static PyObject *__pyx_int_neg_1;
2816 static PyObject *__pyx_tuple_;
2817 static PyObject *__pyx_tuple__2;
2818 static PyObject *__pyx_tuple__3;
2819 static PyObject *__pyx_tuple__4;
2820 static PyObject *__pyx_tuple__5;
2821 static PyObject *__pyx_tuple__6;
2822 static PyObject *__pyx_tuple__7;
2823 static PyObject *__pyx_tuple__8;
2824 static PyObject *__pyx_tuple__9;
2825 static PyObject *__pyx_slice__22;
2826 static PyObject *__pyx_tuple__10;
2827 static PyObject *__pyx_tuple__11;
2828 static PyObject *__pyx_tuple__12;
2829 static PyObject *__pyx_tuple__13;
2830 static PyObject *__pyx_tuple__14;
2831 static PyObject *__pyx_tuple__15;
2832 static PyObject *__pyx_tuple__16;
2833 static PyObject *__pyx_tuple__17;
2834 static PyObject *__pyx_tuple__18;
2835 static PyObject *__pyx_tuple__19;
2836 static PyObject *__pyx_tuple__20;
2837 static PyObject *__pyx_tuple__21;
2838 static PyObject *__pyx_tuple__23;
2839 static PyObject *__pyx_tuple__24;
2840 static PyObject *__pyx_tuple__25;
2841 static PyObject *__pyx_tuple__26;
2842 static PyObject *__pyx_tuple__27;
2843 static PyObject *__pyx_tuple__29;
2844 static PyObject *__pyx_tuple__31;
2845 static PyObject *__pyx_tuple__33;
2846 static PyObject *__pyx_tuple__35;
2847 static PyObject *__pyx_tuple__37;
2848 static PyObject *__pyx_tuple__39;
2849 static PyObject *__pyx_tuple__41;
2850 static PyObject *__pyx_tuple__42;
2851 static PyObject *__pyx_tuple__43;
2852 static PyObject *__pyx_tuple__44;
2853 static PyObject *__pyx_tuple__45;
2854 static PyObject *__pyx_tuple__46;
2855 static PyObject *__pyx_codeobj__28;
2856 static PyObject *__pyx_codeobj__30;
2857 static PyObject *__pyx_codeobj__32;
2858 static PyObject *__pyx_codeobj__34;
2859 static PyObject *__pyx_codeobj__36;
2860 static PyObject *__pyx_codeobj__38;
2861 static PyObject *__pyx_codeobj__40;
2862 static PyObject *__pyx_codeobj__47;
2863 /* Late includes */
2864 
2865 /* "superluWrappers.pyx":15
2866  * class SparseMatrix(object):
2867  *
2868  * def __init__(self, # <<<<<<<<<<<<<<
2869  * nr,
2870  * nc,
2871  */
2872 
2873 /* Python wrapper */
2874 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2875 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2876 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2877  PyObject *__pyx_v_self = 0;
2878  PyObject *__pyx_v_nr = 0;
2879  PyObject *__pyx_v_nc = 0;
2880  PyObject *__pyx_v_nnz = 0;
2881  PyObject *__pyx_v_nzvals = 0;
2882  PyObject *__pyx_v_colind = 0;
2883  PyObject *__pyx_v_rowptr = 0;
2884  int __pyx_lineno = 0;
2885  const char *__pyx_filename = NULL;
2886  int __pyx_clineno = 0;
2887  PyObject *__pyx_r = 0;
2888  __Pyx_RefNannyDeclarations
2889  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2890  {
2891  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzvals,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
2892  PyObject* values[7] = {0,0,0,0,0,0,0};
2893  if (unlikely(__pyx_kwds)) {
2894  Py_ssize_t kw_args;
2895  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2896  switch (pos_args) {
2897  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2898  CYTHON_FALLTHROUGH;
2899  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2900  CYTHON_FALLTHROUGH;
2901  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2902  CYTHON_FALLTHROUGH;
2903  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2904  CYTHON_FALLTHROUGH;
2905  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2906  CYTHON_FALLTHROUGH;
2907  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2908  CYTHON_FALLTHROUGH;
2909  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2910  CYTHON_FALLTHROUGH;
2911  case 0: break;
2912  default: goto __pyx_L5_argtuple_error;
2913  }
2914  kw_args = PyDict_Size(__pyx_kwds);
2915  switch (pos_args) {
2916  case 0:
2917  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2918  else goto __pyx_L5_argtuple_error;
2919  CYTHON_FALLTHROUGH;
2920  case 1:
2921  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
2922  else {
2923  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 1); __PYX_ERR(0, 15, __pyx_L3_error)
2924  }
2925  CYTHON_FALLTHROUGH;
2926  case 2:
2927  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
2928  else {
2929  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 2); __PYX_ERR(0, 15, __pyx_L3_error)
2930  }
2931  CYTHON_FALLTHROUGH;
2932  case 3:
2933  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
2934  else {
2935  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 3); __PYX_ERR(0, 15, __pyx_L3_error)
2936  }
2937  CYTHON_FALLTHROUGH;
2938  case 4:
2939  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzvals)) != 0)) kw_args--;
2940  else {
2941  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 4); __PYX_ERR(0, 15, __pyx_L3_error)
2942  }
2943  CYTHON_FALLTHROUGH;
2944  case 5:
2945  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
2946  else {
2947  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 5); __PYX_ERR(0, 15, __pyx_L3_error)
2948  }
2949  CYTHON_FALLTHROUGH;
2950  case 6:
2951  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
2952  else {
2953  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 6); __PYX_ERR(0, 15, __pyx_L3_error)
2954  }
2955  }
2956  if (unlikely(kw_args > 0)) {
2957  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 15, __pyx_L3_error)
2958  }
2959  } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
2960  goto __pyx_L5_argtuple_error;
2961  } else {
2962  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2963  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2964  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2965  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2966  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2967  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2968  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2969  }
2970  __pyx_v_self = values[0];
2971  __pyx_v_nr = values[1];
2972  __pyx_v_nc = values[2];
2973  __pyx_v_nnz = values[3];
2974  __pyx_v_nzvals = values[4];
2975  __pyx_v_colind = values[5];
2976  __pyx_v_rowptr = values[6];
2977  }
2978  goto __pyx_L4_argument_unpacking_done;
2979  __pyx_L5_argtuple_error:;
2980  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 15, __pyx_L3_error)
2981  __pyx_L3_error:;
2982  __Pyx_AddTraceback("superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2983  __Pyx_RefNannyFinishContext();
2984  return NULL;
2985  __pyx_L4_argument_unpacking_done:;
2986  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix___init__(__pyx_self, __pyx_v_self, __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzvals, __pyx_v_colind, __pyx_v_rowptr);
2987 
2988  /* function exit code */
2989  __Pyx_RefNannyFinishContext();
2990  return __pyx_r;
2991 }
2992 
2993 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr) {
2994  PyObject *__pyx_r = NULL;
2995  __Pyx_RefNannyDeclarations
2996  PyObject *__pyx_t_1 = NULL;
2997  PyObject *__pyx_t_2 = NULL;
2998  PyObject *__pyx_t_3 = NULL;
2999  PyObject *__pyx_t_4 = NULL;
3000  int __pyx_lineno = 0;
3001  const char *__pyx_filename = NULL;
3002  int __pyx_clineno = 0;
3003  __Pyx_RefNannySetupContext("__init__", 0);
3004 
3005  /* "superluWrappers.pyx":22
3006  * colind,
3007  * rowptr):
3008  * self.nr = nr ; self.nc = nc # <<<<<<<<<<<<<<
3009  * self.nnz = nnz
3010  * self.shape = [self.nr, self.nc]
3011  */
3012  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nr, __pyx_v_nr) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
3013  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc, __pyx_v_nc) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
3014 
3015  /* "superluWrappers.pyx":23
3016  * rowptr):
3017  * self.nr = nr ; self.nc = nc
3018  * self.nnz = nnz # <<<<<<<<<<<<<<
3019  * self.shape = [self.nr, self.nc]
3020  * self.nzvals = nzvals
3021  */
3022  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nnz, __pyx_v_nnz) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
3023 
3024  /* "superluWrappers.pyx":24
3025  * self.nr = nr ; self.nc = nc
3026  * self.nnz = nnz
3027  * self.shape = [self.nr, self.nc] # <<<<<<<<<<<<<<
3028  * self.nzvals = nzvals
3029  * self.colind = colind
3030  */
3031  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3032  __Pyx_GOTREF(__pyx_t_1);
3033  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
3034  __Pyx_GOTREF(__pyx_t_2);
3035  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
3036  __Pyx_GOTREF(__pyx_t_3);
3037  __Pyx_GIVEREF(__pyx_t_1);
3038  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3039  __Pyx_GIVEREF(__pyx_t_2);
3040  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
3041  __pyx_t_1 = 0;
3042  __pyx_t_2 = 0;
3043  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
3044  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3045 
3046  /* "superluWrappers.pyx":25
3047  * self.nnz = nnz
3048  * self.shape = [self.nr, self.nc]
3049  * self.nzvals = nzvals # <<<<<<<<<<<<<<
3050  * self.colind = colind
3051  * self.rowptr = rowptr
3052  */
3053  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nzvals, __pyx_v_nzvals) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3054 
3055  /* "superluWrappers.pyx":26
3056  * self.shape = [self.nr, self.nc]
3057  * self.nzvals = nzvals
3058  * self.colind = colind # <<<<<<<<<<<<<<
3059  * self.rowptr = rowptr
3060  * self._cSparseMatrix = cSparseMatrix(nr,
3061  */
3062  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_colind, __pyx_v_colind) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
3063 
3064  /* "superluWrappers.pyx":27
3065  * self.nzvals = nzvals
3066  * self.colind = colind
3067  * self.rowptr = rowptr # <<<<<<<<<<<<<<
3068  * self._cSparseMatrix = cSparseMatrix(nr,
3069  * nc,
3070  */
3071  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rowptr, __pyx_v_rowptr) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
3072 
3073  /* "superluWrappers.pyx":31
3074  * nc,
3075  * nnz,
3076  * self.nzvals, # <<<<<<<<<<<<<<
3077  * self.colind,
3078  * self.rowptr)
3079  */
3080  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
3081  __Pyx_GOTREF(__pyx_t_3);
3082 
3083  /* "superluWrappers.pyx":32
3084  * nnz,
3085  * self.nzvals,
3086  * self.colind, # <<<<<<<<<<<<<<
3087  * self.rowptr)
3088  *
3089  */
3090  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
3091  __Pyx_GOTREF(__pyx_t_2);
3092 
3093  /* "superluWrappers.pyx":33
3094  * self.nzvals,
3095  * self.colind,
3096  * self.rowptr) # <<<<<<<<<<<<<<
3097  *
3098  * def matvec(self, x, y):
3099  */
3100  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3101  __Pyx_GOTREF(__pyx_t_1);
3102 
3103  /* "superluWrappers.pyx":28
3104  * self.colind = colind
3105  * self.rowptr = rowptr
3106  * self._cSparseMatrix = cSparseMatrix(nr, # <<<<<<<<<<<<<<
3107  * nc,
3108  * nnz,
3109  */
3110  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
3111  __Pyx_GOTREF(__pyx_t_4);
3112  __Pyx_INCREF(__pyx_v_nr);
3113  __Pyx_GIVEREF(__pyx_v_nr);
3114  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nr);
3115  __Pyx_INCREF(__pyx_v_nc);
3116  __Pyx_GIVEREF(__pyx_v_nc);
3117  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_nc);
3118  __Pyx_INCREF(__pyx_v_nnz);
3119  __Pyx_GIVEREF(__pyx_v_nnz);
3120  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nnz);
3121  __Pyx_GIVEREF(__pyx_t_3);
3122  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
3123  __Pyx_GIVEREF(__pyx_t_2);
3124  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2);
3125  __Pyx_GIVEREF(__pyx_t_1);
3126  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1);
3127  __pyx_t_3 = 0;
3128  __pyx_t_2 = 0;
3129  __pyx_t_1 = 0;
3130  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_15superluWrappers_cSparseMatrix), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
3131  __Pyx_GOTREF(__pyx_t_1);
3132  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3133  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3134  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3135 
3136  /* "superluWrappers.pyx":15
3137  * class SparseMatrix(object):
3138  *
3139  * def __init__(self, # <<<<<<<<<<<<<<
3140  * nr,
3141  * nc,
3142  */
3143 
3144  /* function exit code */
3145  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3146  goto __pyx_L0;
3147  __pyx_L1_error:;
3148  __Pyx_XDECREF(__pyx_t_1);
3149  __Pyx_XDECREF(__pyx_t_2);
3150  __Pyx_XDECREF(__pyx_t_3);
3151  __Pyx_XDECREF(__pyx_t_4);
3152  __Pyx_AddTraceback("superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3153  __pyx_r = NULL;
3154  __pyx_L0:;
3155  __Pyx_XGIVEREF(__pyx_r);
3156  __Pyx_RefNannyFinishContext();
3157  return __pyx_r;
3158 }
3159 
3160 /* "superluWrappers.pyx":35
3161  * self.rowptr)
3162  *
3163  * def matvec(self, x, y): # <<<<<<<<<<<<<<
3164  * """
3165  * Compute the sparse matrix-vector product y = Ax
3166  */
3167 
3168 /* Python wrapper */
3169 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3170 static char __pyx_doc_15superluWrappers_12SparseMatrix_2matvec[] = "\n Compute the sparse matrix-vector product y = Ax\n\n Arguments\n ---------\n x (input) : numpy array\n y (output) : numpy array\n ";
3171 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_3matvec = {"matvec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_3matvec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_2matvec};
3172 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3173  PyObject *__pyx_v_self = 0;
3174  PyObject *__pyx_v_x = 0;
3175  PyObject *__pyx_v_y = 0;
3176  int __pyx_lineno = 0;
3177  const char *__pyx_filename = NULL;
3178  int __pyx_clineno = 0;
3179  PyObject *__pyx_r = 0;
3180  __Pyx_RefNannyDeclarations
3181  __Pyx_RefNannySetupContext("matvec (wrapper)", 0);
3182  {
3183  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,0};
3184  PyObject* values[3] = {0,0,0};
3185  if (unlikely(__pyx_kwds)) {
3186  Py_ssize_t kw_args;
3187  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3188  switch (pos_args) {
3189  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3190  CYTHON_FALLTHROUGH;
3191  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3192  CYTHON_FALLTHROUGH;
3193  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3194  CYTHON_FALLTHROUGH;
3195  case 0: break;
3196  default: goto __pyx_L5_argtuple_error;
3197  }
3198  kw_args = PyDict_Size(__pyx_kwds);
3199  switch (pos_args) {
3200  case 0:
3201  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3202  else goto __pyx_L5_argtuple_error;
3203  CYTHON_FALLTHROUGH;
3204  case 1:
3205  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3206  else {
3207  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, 1); __PYX_ERR(0, 35, __pyx_L3_error)
3208  }
3209  CYTHON_FALLTHROUGH;
3210  case 2:
3211  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3212  else {
3213  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, 2); __PYX_ERR(0, 35, __pyx_L3_error)
3214  }
3215  }
3216  if (unlikely(kw_args > 0)) {
3217  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matvec") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
3218  }
3219  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3220  goto __pyx_L5_argtuple_error;
3221  } else {
3222  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3223  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3224  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3225  }
3226  __pyx_v_self = values[0];
3227  __pyx_v_x = values[1];
3228  __pyx_v_y = values[2];
3229  }
3230  goto __pyx_L4_argument_unpacking_done;
3231  __pyx_L5_argtuple_error:;
3232  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error)
3233  __pyx_L3_error:;
3234  __Pyx_AddTraceback("superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3235  __Pyx_RefNannyFinishContext();
3236  return NULL;
3237  __pyx_L4_argument_unpacking_done:;
3238  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_2matvec(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);
3239 
3240  /* function exit code */
3241  __Pyx_RefNannyFinishContext();
3242  return __pyx_r;
3243 }
3244 
3245 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
3246  PyObject *__pyx_r = NULL;
3247  __Pyx_RefNannyDeclarations
3248  PyObject *__pyx_t_1 = NULL;
3249  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
3250  __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
3251  int __pyx_lineno = 0;
3252  const char *__pyx_filename = NULL;
3253  int __pyx_clineno = 0;
3254  __Pyx_RefNannySetupContext("matvec", 0);
3255 
3256  /* "superluWrappers.pyx":44
3257  * y (output) : numpy array
3258  * """
3259  * SparseMatrix_matvec(self._cSparseMatrix, x, y) # <<<<<<<<<<<<<<
3260  *
3261  * def fwrite(self, filename, base):
3262  */
3263  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
3264  __Pyx_GOTREF(__pyx_t_1);
3265  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 44, __pyx_L1_error)
3266  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3267  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_y, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3268  __pyx_f_15superluWrappers_SparseMatrix_matvec(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3);
3269  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3270  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3271  __pyx_t_2.memview = NULL;
3272  __pyx_t_2.data = NULL;
3273  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3274  __pyx_t_3.memview = NULL;
3275  __pyx_t_3.data = NULL;
3276 
3277  /* "superluWrappers.pyx":35
3278  * self.rowptr)
3279  *
3280  * def matvec(self, x, y): # <<<<<<<<<<<<<<
3281  * """
3282  * Compute the sparse matrix-vector product y = Ax
3283  */
3284 
3285  /* function exit code */
3286  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3287  goto __pyx_L0;
3288  __pyx_L1_error:;
3289  __Pyx_XDECREF(__pyx_t_1);
3290  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3291  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3292  __Pyx_AddTraceback("superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3293  __pyx_r = NULL;
3294  __pyx_L0:;
3295  __Pyx_XGIVEREF(__pyx_r);
3296  __Pyx_RefNannyFinishContext();
3297  return __pyx_r;
3298 }
3299 
3300 /* "superluWrappers.pyx":46
3301  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
3302  *
3303  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
3304  * """ Write the sparse matrix to a file
3305  *
3306  */
3307 
3308 /* Python wrapper */
3309 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3310 static char __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite[] = " Write the sparse matrix to a file\n\n Arguments\n ---------\n filename : str\n The output filename\n base : int\n ?!Possibly something to do with parallel?!\n ";
3311 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite = {"fwrite", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite};
3312 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3313  PyObject *__pyx_v_self = 0;
3314  PyObject *__pyx_v_filename = 0;
3315  PyObject *__pyx_v_base = 0;
3316  int __pyx_lineno = 0;
3317  const char *__pyx_filename = NULL;
3318  int __pyx_clineno = 0;
3319  PyObject *__pyx_r = 0;
3320  __Pyx_RefNannyDeclarations
3321  __Pyx_RefNannySetupContext("fwrite (wrapper)", 0);
3322  {
3323  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,&__pyx_n_s_base,0};
3324  PyObject* values[3] = {0,0,0};
3325  if (unlikely(__pyx_kwds)) {
3326  Py_ssize_t kw_args;
3327  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3328  switch (pos_args) {
3329  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3330  CYTHON_FALLTHROUGH;
3331  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3332  CYTHON_FALLTHROUGH;
3333  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3334  CYTHON_FALLTHROUGH;
3335  case 0: break;
3336  default: goto __pyx_L5_argtuple_error;
3337  }
3338  kw_args = PyDict_Size(__pyx_kwds);
3339  switch (pos_args) {
3340  case 0:
3341  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3342  else goto __pyx_L5_argtuple_error;
3343  CYTHON_FALLTHROUGH;
3344  case 1:
3345  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
3346  else {
3347  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, 1); __PYX_ERR(0, 46, __pyx_L3_error)
3348  }
3349  CYTHON_FALLTHROUGH;
3350  case 2:
3351  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
3352  else {
3353  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, 2); __PYX_ERR(0, 46, __pyx_L3_error)
3354  }
3355  }
3356  if (unlikely(kw_args > 0)) {
3357  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fwrite") < 0)) __PYX_ERR(0, 46, __pyx_L3_error)
3358  }
3359  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3360  goto __pyx_L5_argtuple_error;
3361  } else {
3362  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3363  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3364  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3365  }
3366  __pyx_v_self = values[0];
3367  __pyx_v_filename = values[1];
3368  __pyx_v_base = values[2];
3369  }
3370  goto __pyx_L4_argument_unpacking_done;
3371  __pyx_L5_argtuple_error:;
3372  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 46, __pyx_L3_error)
3373  __pyx_L3_error:;
3374  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3375  __Pyx_RefNannyFinishContext();
3376  return NULL;
3377  __pyx_L4_argument_unpacking_done:;
3378  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(__pyx_self, __pyx_v_self, __pyx_v_filename, __pyx_v_base);
3379 
3380  /* function exit code */
3381  __Pyx_RefNannyFinishContext();
3382  return __pyx_r;
3383 }
3384 
3385 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base) {
3386  PyObject *__pyx_v_output_file = NULL;
3387  PyObject *__pyx_v_i = NULL;
3388  PyObject *__pyx_v_k = NULL;
3389  PyObject *__pyx_r = NULL;
3390  __Pyx_RefNannyDeclarations
3391  PyObject *__pyx_t_1 = NULL;
3392  PyObject *__pyx_t_2 = NULL;
3393  PyObject *__pyx_t_3 = NULL;
3394  PyObject *__pyx_t_4 = NULL;
3395  PyObject *__pyx_t_5 = NULL;
3396  PyObject *__pyx_t_6 = NULL;
3397  PyObject *__pyx_t_7 = NULL;
3398  PyObject *__pyx_t_8 = NULL;
3399  PyObject *__pyx_t_9 = NULL;
3400  PyObject *__pyx_t_10 = NULL;
3401  PyObject *__pyx_t_11 = NULL;
3402  Py_ssize_t __pyx_t_12;
3403  PyObject *(*__pyx_t_13)(PyObject *);
3404  Py_ssize_t __pyx_t_14;
3405  PyObject *(*__pyx_t_15)(PyObject *);
3406  PyObject *__pyx_t_16 = NULL;
3407  PyObject *__pyx_t_17 = NULL;
3408  int __pyx_t_18;
3409  int __pyx_t_19;
3410  int __pyx_lineno = 0;
3411  const char *__pyx_filename = NULL;
3412  int __pyx_clineno = 0;
3413  __Pyx_RefNannySetupContext("fwrite", 0);
3414 
3415  /* "superluWrappers.pyx":56
3416  * ?!Possibly something to do with parallel?!
3417  * """
3418  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
3419  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3420  * for i in range(self.nr):
3421  */
3422  /*with:*/ {
3423  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
3424  __Pyx_GOTREF(__pyx_t_1);
3425  __Pyx_INCREF(__pyx_v_filename);
3426  __Pyx_GIVEREF(__pyx_v_filename);
3427  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
3428  __Pyx_INCREF(__pyx_n_s_w);
3429  __Pyx_GIVEREF(__pyx_n_s_w);
3430  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_w);
3431  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
3432  __Pyx_GOTREF(__pyx_t_2);
3433  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3434  __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
3435  __Pyx_GOTREF(__pyx_t_3);
3436  __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L3_error)
3437  __Pyx_GOTREF(__pyx_t_4);
3438  __pyx_t_5 = NULL;
3439  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3440  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3441  if (likely(__pyx_t_5)) {
3442  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3443  __Pyx_INCREF(__pyx_t_5);
3444  __Pyx_INCREF(function);
3445  __Pyx_DECREF_SET(__pyx_t_4, function);
3446  }
3447  }
3448  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
3449  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3450  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L3_error)
3451  __Pyx_GOTREF(__pyx_t_1);
3452  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3453  __pyx_t_4 = __pyx_t_1;
3454  __pyx_t_1 = 0;
3455  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3456  /*try:*/ {
3457  {
3458  __Pyx_PyThreadState_declare
3459  __Pyx_PyThreadState_assign
3460  __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3461  __Pyx_XGOTREF(__pyx_t_6);
3462  __Pyx_XGOTREF(__pyx_t_7);
3463  __Pyx_XGOTREF(__pyx_t_8);
3464  /*try:*/ {
3465  __pyx_v_output_file = __pyx_t_4;
3466  __pyx_t_4 = 0;
3467 
3468  /* "superluWrappers.pyx":57
3469  * """
3470  * with open(filename, 'w') as output_file:
3471  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) ) # <<<<<<<<<<<<<<
3472  * for i in range(self.nr):
3473  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3474  */
3475  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L7_error)
3476  __Pyx_GOTREF(__pyx_t_2);
3477  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L7_error)
3478  __Pyx_GOTREF(__pyx_t_1);
3479  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L7_error)
3480  __Pyx_GOTREF(__pyx_t_5);
3481  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L7_error)
3482  __Pyx_GOTREF(__pyx_t_9);
3483  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3484  __Pyx_GOTREF(__pyx_t_10);
3485  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3486  __Pyx_GOTREF(__pyx_t_11);
3487  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3488  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3489  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3490  __Pyx_GOTREF(__pyx_t_10);
3491  __Pyx_GIVEREF(__pyx_t_1);
3492  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
3493  __Pyx_GIVEREF(__pyx_t_5);
3494  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
3495  __Pyx_GIVEREF(__pyx_t_11);
3496  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_11);
3497  __pyx_t_1 = 0;
3498  __pyx_t_5 = 0;
3499  __pyx_t_11 = 0;
3500  __pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_i_i_i, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3501  __Pyx_GOTREF(__pyx_t_11);
3502  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3503  __pyx_t_10 = NULL;
3504  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3505  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
3506  if (likely(__pyx_t_10)) {
3507  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3508  __Pyx_INCREF(__pyx_t_10);
3509  __Pyx_INCREF(function);
3510  __Pyx_DECREF_SET(__pyx_t_2, function);
3511  }
3512  }
3513  __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11);
3514  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3515  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3516  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3517  __Pyx_GOTREF(__pyx_t_4);
3518  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3519  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3520 
3521  /* "superluWrappers.pyx":58
3522  * with open(filename, 'w') as output_file:
3523  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3524  * for i in range(self.nr): # <<<<<<<<<<<<<<
3525  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3526  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3527  */
3528  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3529  __Pyx_GOTREF(__pyx_t_4);
3530  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3531  __Pyx_GOTREF(__pyx_t_2);
3532  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3533  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
3534  __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0;
3535  __pyx_t_13 = NULL;
3536  } else {
3537  __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3538  __Pyx_GOTREF(__pyx_t_4);
3539  __pyx_t_13 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 58, __pyx_L7_error)
3540  }
3541  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3542  for (;;) {
3543  if (likely(!__pyx_t_13)) {
3544  if (likely(PyList_CheckExact(__pyx_t_4))) {
3545  if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4)) break;
3546  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3547  __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3548  #else
3549  __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3550  __Pyx_GOTREF(__pyx_t_2);
3551  #endif
3552  } else {
3553  if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
3554  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3555  __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3556  #else
3557  __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3558  __Pyx_GOTREF(__pyx_t_2);
3559  #endif
3560  }
3561  } else {
3562  __pyx_t_2 = __pyx_t_13(__pyx_t_4);
3563  if (unlikely(!__pyx_t_2)) {
3564  PyObject* exc_type = PyErr_Occurred();
3565  if (exc_type) {
3566  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3567  else __PYX_ERR(0, 58, __pyx_L7_error)
3568  }
3569  break;
3570  }
3571  __Pyx_GOTREF(__pyx_t_2);
3572  }
3573  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
3574  __pyx_t_2 = 0;
3575 
3576  /* "superluWrappers.pyx":59
3577  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3578  * for i in range(self.nr):
3579  * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
3580  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3581  *
3582  */
3583  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3584  __Pyx_GOTREF(__pyx_t_2);
3585  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_i); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
3586  __Pyx_GOTREF(__pyx_t_11);
3587  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3588  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3589  __Pyx_GOTREF(__pyx_t_2);
3590  __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3591  __Pyx_GOTREF(__pyx_t_10);
3592  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3593  __Pyx_GOTREF(__pyx_t_5);
3594  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3595  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3596  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3597  __Pyx_GOTREF(__pyx_t_10);
3598  __Pyx_GIVEREF(__pyx_t_11);
3599  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
3600  __Pyx_GIVEREF(__pyx_t_5);
3601  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
3602  __pyx_t_11 = 0;
3603  __pyx_t_5 = 0;
3604  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3605  __Pyx_GOTREF(__pyx_t_5);
3606  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3607  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
3608  __pyx_t_10 = __pyx_t_5; __Pyx_INCREF(__pyx_t_10); __pyx_t_14 = 0;
3609  __pyx_t_15 = NULL;
3610  } else {
3611  __pyx_t_14 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3612  __Pyx_GOTREF(__pyx_t_10);
3613  __pyx_t_15 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 59, __pyx_L7_error)
3614  }
3615  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3616  for (;;) {
3617  if (likely(!__pyx_t_15)) {
3618  if (likely(PyList_CheckExact(__pyx_t_10))) {
3619  if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_10)) break;
3620  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3621  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3622  #else
3623  __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3624  __Pyx_GOTREF(__pyx_t_5);
3625  #endif
3626  } else {
3627  if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
3628  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3629  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3630  #else
3631  __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3632  __Pyx_GOTREF(__pyx_t_5);
3633  #endif
3634  }
3635  } else {
3636  __pyx_t_5 = __pyx_t_15(__pyx_t_10);
3637  if (unlikely(!__pyx_t_5)) {
3638  PyObject* exc_type = PyErr_Occurred();
3639  if (exc_type) {
3640  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3641  else __PYX_ERR(0, 59, __pyx_L7_error)
3642  }
3643  break;
3644  }
3645  __Pyx_GOTREF(__pyx_t_5);
3646  }
3647  __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
3648  __pyx_t_5 = 0;
3649 
3650  /* "superluWrappers.pyx":60
3651  * for i in range(self.nr):
3652  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3653  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) ) # <<<<<<<<<<<<<<
3654  *
3655  * def getCSRrepresentation(self):
3656  */
3657  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L7_error)
3658  __Pyx_GOTREF(__pyx_t_11);
3659  __pyx_t_2 = PyNumber_Add(__pyx_v_i, __pyx_v_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L7_error)
3660  __Pyx_GOTREF(__pyx_t_2);
3661  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3662  __Pyx_GOTREF(__pyx_t_1);
3663  __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_k); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3664  __Pyx_GOTREF(__pyx_t_9);
3665  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3666  __pyx_t_1 = PyNumber_Add(__pyx_t_9, __pyx_v_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3667  __Pyx_GOTREF(__pyx_t_1);
3668  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3669  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3670  __Pyx_GOTREF(__pyx_t_9);
3671  __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_k); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3672  __Pyx_GOTREF(__pyx_t_16);
3673  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3674  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3675  __Pyx_GOTREF(__pyx_t_9);
3676  __Pyx_GIVEREF(__pyx_t_2);
3677  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
3678  __Pyx_GIVEREF(__pyx_t_1);
3679  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
3680  __Pyx_GIVEREF(__pyx_t_16);
3681  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_16);
3682  __pyx_t_2 = 0;
3683  __pyx_t_1 = 0;
3684  __pyx_t_16 = 0;
3685  __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_d_d_13_8e, __pyx_t_9); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3686  __Pyx_GOTREF(__pyx_t_16);
3687  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3688  __pyx_t_9 = NULL;
3689  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
3690  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
3691  if (likely(__pyx_t_9)) {
3692  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
3693  __Pyx_INCREF(__pyx_t_9);
3694  __Pyx_INCREF(function);
3695  __Pyx_DECREF_SET(__pyx_t_11, function);
3696  }
3697  }
3698  __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_9, __pyx_t_16) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_16);
3699  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3700  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3701  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L7_error)
3702  __Pyx_GOTREF(__pyx_t_5);
3703  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3704  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3705 
3706  /* "superluWrappers.pyx":59
3707  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3708  * for i in range(self.nr):
3709  * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
3710  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3711  *
3712  */
3713  }
3714  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3715 
3716  /* "superluWrappers.pyx":58
3717  * with open(filename, 'w') as output_file:
3718  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3719  * for i in range(self.nr): # <<<<<<<<<<<<<<
3720  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3721  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3722  */
3723  }
3724  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3725 
3726  /* "superluWrappers.pyx":56
3727  * ?!Possibly something to do with parallel?!
3728  * """
3729  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
3730  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3731  * for i in range(self.nr):
3732  */
3733  }
3734  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3735  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3736  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3737  goto __pyx_L12_try_end;
3738  __pyx_L7_error:;
3739  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3740  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3741  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
3742  __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3743  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3744  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3745  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3746  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3747  /*except:*/ {
3748  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3749  if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_5) < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3750  __Pyx_GOTREF(__pyx_t_4);
3751  __Pyx_GOTREF(__pyx_t_10);
3752  __Pyx_GOTREF(__pyx_t_5);
3753  __pyx_t_11 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3754  __Pyx_GOTREF(__pyx_t_11);
3755  __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL);
3756  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3757  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3758  if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3759  __Pyx_GOTREF(__pyx_t_17);
3760  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_17);
3761  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3762  if (__pyx_t_18 < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3763  __pyx_t_19 = ((!(__pyx_t_18 != 0)) != 0);
3764  if (__pyx_t_19) {
3765  __Pyx_GIVEREF(__pyx_t_4);
3766  __Pyx_GIVEREF(__pyx_t_10);
3767  __Pyx_XGIVEREF(__pyx_t_5);
3768  __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_10, __pyx_t_5);
3769  __pyx_t_4 = 0; __pyx_t_10 = 0; __pyx_t_5 = 0;
3770  __PYX_ERR(0, 56, __pyx_L9_except_error)
3771  }
3772  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3773  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3774  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3775  goto __pyx_L8_exception_handled;
3776  }
3777  __pyx_L9_except_error:;
3778  __Pyx_XGIVEREF(__pyx_t_6);
3779  __Pyx_XGIVEREF(__pyx_t_7);
3780  __Pyx_XGIVEREF(__pyx_t_8);
3781  __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3782  goto __pyx_L1_error;
3783  __pyx_L8_exception_handled:;
3784  __Pyx_XGIVEREF(__pyx_t_6);
3785  __Pyx_XGIVEREF(__pyx_t_7);
3786  __Pyx_XGIVEREF(__pyx_t_8);
3787  __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3788  __pyx_L12_try_end:;
3789  }
3790  }
3791  /*finally:*/ {
3792  /*normal exit:*/{
3793  if (__pyx_t_3) {
3794  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL);
3795  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3796  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L1_error)
3797  __Pyx_GOTREF(__pyx_t_8);
3798  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3799  }
3800  goto __pyx_L6;
3801  }
3802  __pyx_L6:;
3803  }
3804  goto __pyx_L20;
3805  __pyx_L3_error:;
3806  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3807  goto __pyx_L1_error;
3808  __pyx_L20:;
3809  }
3810 
3811  /* "superluWrappers.pyx":46
3812  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
3813  *
3814  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
3815  * """ Write the sparse matrix to a file
3816  *
3817  */
3818 
3819  /* function exit code */
3820  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3821  goto __pyx_L0;
3822  __pyx_L1_error:;
3823  __Pyx_XDECREF(__pyx_t_1);
3824  __Pyx_XDECREF(__pyx_t_2);
3825  __Pyx_XDECREF(__pyx_t_4);
3826  __Pyx_XDECREF(__pyx_t_5);
3827  __Pyx_XDECREF(__pyx_t_9);
3828  __Pyx_XDECREF(__pyx_t_10);
3829  __Pyx_XDECREF(__pyx_t_11);
3830  __Pyx_XDECREF(__pyx_t_16);
3831  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3832  __pyx_r = NULL;
3833  __pyx_L0:;
3834  __Pyx_XDECREF(__pyx_v_output_file);
3835  __Pyx_XDECREF(__pyx_v_i);
3836  __Pyx_XDECREF(__pyx_v_k);
3837  __Pyx_XGIVEREF(__pyx_r);
3838  __Pyx_RefNannyFinishContext();
3839  return __pyx_r;
3840 }
3841 
3842 /* "superluWrappers.pyx":62
3843  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3844  *
3845  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
3846  * """ Get the CSR representation of the sparse matrix.
3847  *
3848  */
3849 
3850 /* Python wrapper */
3851 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3852 static char __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation[] = " Get the CSR representation of the sparse matrix.\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colptr, vals)\n ";
3853 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation = {"getCSRrepresentation", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation, METH_O, __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation};
3854 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3855  PyObject *__pyx_r = 0;
3856  __Pyx_RefNannyDeclarations
3857  __Pyx_RefNannySetupContext("getCSRrepresentation (wrapper)", 0);
3858  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(__pyx_self, ((PyObject *)__pyx_v_self));
3859 
3860  /* function exit code */
3861  __Pyx_RefNannyFinishContext();
3862  return __pyx_r;
3863 }
3864 
3865 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
3866  PyObject *__pyx_r = NULL;
3867  __Pyx_RefNannyDeclarations
3868  PyObject *__pyx_t_1 = NULL;
3869  PyObject *__pyx_t_2 = NULL;
3870  PyObject *__pyx_t_3 = NULL;
3871  PyObject *__pyx_t_4 = NULL;
3872  int __pyx_lineno = 0;
3873  const char *__pyx_filename = NULL;
3874  int __pyx_clineno = 0;
3875  __Pyx_RefNannySetupContext("getCSRrepresentation", 0);
3876 
3877  /* "superluWrappers.pyx":70
3878  * (rowptr, colptr, vals)
3879  * """
3880  * return (self.rowptr, self.colind, self.nzvals) # <<<<<<<<<<<<<<
3881  *
3882  * def getSubMatCSRrepresentation(self,
3883  */
3884  __Pyx_XDECREF(__pyx_r);
3885  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
3886  __Pyx_GOTREF(__pyx_t_1);
3887  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
3888  __Pyx_GOTREF(__pyx_t_2);
3889  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
3890  __Pyx_GOTREF(__pyx_t_3);
3891  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
3892  __Pyx_GOTREF(__pyx_t_4);
3893  __Pyx_GIVEREF(__pyx_t_1);
3894  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3895  __Pyx_GIVEREF(__pyx_t_2);
3896  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
3897  __Pyx_GIVEREF(__pyx_t_3);
3898  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
3899  __pyx_t_1 = 0;
3900  __pyx_t_2 = 0;
3901  __pyx_t_3 = 0;
3902  __pyx_r = __pyx_t_4;
3903  __pyx_t_4 = 0;
3904  goto __pyx_L0;
3905 
3906  /* "superluWrappers.pyx":62
3907  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3908  *
3909  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
3910  * """ Get the CSR representation of the sparse matrix.
3911  *
3912  */
3913 
3914  /* function exit code */
3915  __pyx_L1_error:;
3916  __Pyx_XDECREF(__pyx_t_1);
3917  __Pyx_XDECREF(__pyx_t_2);
3918  __Pyx_XDECREF(__pyx_t_3);
3919  __Pyx_XDECREF(__pyx_t_4);
3920  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
3921  __pyx_r = NULL;
3922  __pyx_L0:;
3923  __Pyx_XGIVEREF(__pyx_r);
3924  __Pyx_RefNannyFinishContext();
3925  return __pyx_r;
3926 }
3927 
3928 /* "superluWrappers.pyx":72
3929  * return (self.rowptr, self.colind, self.nzvals)
3930  *
3931  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
3932  * range_start,
3933  * range_end):
3934  */
3935 
3936 /* Python wrapper */
3937 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3938 static char __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation[] = " Get the CSR representation for a submatrix.\n\n Arguments\n ---------\n range_start : int\n range_end : int\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colind, nzvals)\n ";
3939 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation = {"getSubMatCSRrepresentation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation};
3940 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3941  PyObject *__pyx_v_self = 0;
3942  PyObject *__pyx_v_range_start = 0;
3943  PyObject *__pyx_v_range_end = 0;
3944  int __pyx_lineno = 0;
3945  const char *__pyx_filename = NULL;
3946  int __pyx_clineno = 0;
3947  PyObject *__pyx_r = 0;
3948  __Pyx_RefNannyDeclarations
3949  __Pyx_RefNannySetupContext("getSubMatCSRrepresentation (wrapper)", 0);
3950  {
3951  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_range_start,&__pyx_n_s_range_end,0};
3952  PyObject* values[3] = {0,0,0};
3953  if (unlikely(__pyx_kwds)) {
3954  Py_ssize_t kw_args;
3955  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3956  switch (pos_args) {
3957  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3958  CYTHON_FALLTHROUGH;
3959  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3960  CYTHON_FALLTHROUGH;
3961  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3962  CYTHON_FALLTHROUGH;
3963  case 0: break;
3964  default: goto __pyx_L5_argtuple_error;
3965  }
3966  kw_args = PyDict_Size(__pyx_kwds);
3967  switch (pos_args) {
3968  case 0:
3969  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3970  else goto __pyx_L5_argtuple_error;
3971  CYTHON_FALLTHROUGH;
3972  case 1:
3973  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_start)) != 0)) kw_args--;
3974  else {
3975  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, 1); __PYX_ERR(0, 72, __pyx_L3_error)
3976  }
3977  CYTHON_FALLTHROUGH;
3978  case 2:
3979  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_end)) != 0)) kw_args--;
3980  else {
3981  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, 2); __PYX_ERR(0, 72, __pyx_L3_error)
3982  }
3983  }
3984  if (unlikely(kw_args > 0)) {
3985  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getSubMatCSRrepresentation") < 0)) __PYX_ERR(0, 72, __pyx_L3_error)
3986  }
3987  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3988  goto __pyx_L5_argtuple_error;
3989  } else {
3990  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3991  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3992  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3993  }
3994  __pyx_v_self = values[0];
3995  __pyx_v_range_start = values[1];
3996  __pyx_v_range_end = values[2];
3997  }
3998  goto __pyx_L4_argument_unpacking_done;
3999  __pyx_L5_argtuple_error:;
4000  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error)
4001  __pyx_L3_error:;
4002  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
4003  __Pyx_RefNannyFinishContext();
4004  return NULL;
4005  __pyx_L4_argument_unpacking_done:;
4006  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(__pyx_self, __pyx_v_self, __pyx_v_range_start, __pyx_v_range_end);
4007 
4008  /* function exit code */
4009  __Pyx_RefNannyFinishContext();
4010  return __pyx_r;
4011 }
4012 
4013 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end) {
4014  PyObject *__pyx_v__rows = NULL;
4015  PyObject *__pyx_v_nnz = NULL;
4016  PyObject *__pyx_v_rowptr = NULL;
4017  PyObject *__pyx_v_colind = NULL;
4018  PyObject *__pyx_v_nzvals = NULL;
4019  PyObject *__pyx_r = NULL;
4020  __Pyx_RefNannyDeclarations
4021  PyObject *__pyx_t_1 = NULL;
4022  int __pyx_t_2;
4023  PyObject *__pyx_t_3 = NULL;
4024  PyObject *__pyx_t_4 = NULL;
4025  PyObject *__pyx_t_5 = NULL;
4026  int __pyx_lineno = 0;
4027  const char *__pyx_filename = NULL;
4028  int __pyx_clineno = 0;
4029  __Pyx_RefNannySetupContext("getSubMatCSRrepresentation", 0);
4030 
4031  /* "superluWrappers.pyx":87
4032  * (rowptr, colind, nzvals)
4033  * """
4034  * assert range_start >= 0 ; assert range_end <= self.nr # <<<<<<<<<<<<<<
4035  * assert range_end > range_start
4036  * _rows = range_end - range_start
4037  */
4038  #ifndef CYTHON_WITHOUT_ASSERTIONS
4039  if (unlikely(!Py_OptimizeFlag)) {
4040  __pyx_t_1 = PyObject_RichCompare(__pyx_v_range_start, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
4041  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
4042  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4043  if (unlikely(!__pyx_t_2)) {
4044  PyErr_SetNone(PyExc_AssertionError);
4045  __PYX_ERR(0, 87, __pyx_L1_error)
4046  }
4047  }
4048  #endif
4049  #ifndef CYTHON_WITHOUT_ASSERTIONS
4050  if (unlikely(!Py_OptimizeFlag)) {
4051  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
4052  __Pyx_GOTREF(__pyx_t_1);
4053  __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
4054  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4055  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
4056  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4057  if (unlikely(!__pyx_t_2)) {
4058  PyErr_SetNone(PyExc_AssertionError);
4059  __PYX_ERR(0, 87, __pyx_L1_error)
4060  }
4061  }
4062  #endif
4063 
4064  /* "superluWrappers.pyx":88
4065  * """
4066  * assert range_start >= 0 ; assert range_end <= self.nr
4067  * assert range_end > range_start # <<<<<<<<<<<<<<
4068  * _rows = range_end - range_start
4069  * assert _rows <= self.nr
4070  */
4071  #ifndef CYTHON_WITHOUT_ASSERTIONS
4072  if (unlikely(!Py_OptimizeFlag)) {
4073  __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_v_range_start, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
4074  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 88, __pyx_L1_error)
4075  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4076  if (unlikely(!__pyx_t_2)) {
4077  PyErr_SetNone(PyExc_AssertionError);
4078  __PYX_ERR(0, 88, __pyx_L1_error)
4079  }
4080  }
4081  #endif
4082 
4083  /* "superluWrappers.pyx":89
4084  * assert range_start >= 0 ; assert range_end <= self.nr
4085  * assert range_end > range_start
4086  * _rows = range_end - range_start # <<<<<<<<<<<<<<
4087  * assert _rows <= self.nr
4088  *
4089  */
4090  __pyx_t_3 = PyNumber_Subtract(__pyx_v_range_end, __pyx_v_range_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
4091  __Pyx_GOTREF(__pyx_t_3);
4092  __pyx_v__rows = __pyx_t_3;
4093  __pyx_t_3 = 0;
4094 
4095  /* "superluWrappers.pyx":90
4096  * assert range_end > range_start
4097  * _rows = range_end - range_start
4098  * assert _rows <= self.nr # <<<<<<<<<<<<<<
4099  *
4100  * nnz = self.rowptr[range_end] - self.rowptr[range_start]
4101  */
4102  #ifndef CYTHON_WITHOUT_ASSERTIONS
4103  if (unlikely(!Py_OptimizeFlag)) {
4104  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
4105  __Pyx_GOTREF(__pyx_t_3);
4106  __pyx_t_1 = PyObject_RichCompare(__pyx_v__rows, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
4107  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4108  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 90, __pyx_L1_error)
4109  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4110  if (unlikely(!__pyx_t_2)) {
4111  PyErr_SetNone(PyExc_AssertionError);
4112  __PYX_ERR(0, 90, __pyx_L1_error)
4113  }
4114  }
4115  #endif
4116 
4117  /* "superluWrappers.pyx":92
4118  * assert _rows <= self.nr
4119  *
4120  * nnz = self.rowptr[range_end] - self.rowptr[range_start] # <<<<<<<<<<<<<<
4121  *
4122  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4123  */
4124  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4125  __Pyx_GOTREF(__pyx_t_1);
4126  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
4127  __Pyx_GOTREF(__pyx_t_3);
4128  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4129  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4130  __Pyx_GOTREF(__pyx_t_1);
4131  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
4132  __Pyx_GOTREF(__pyx_t_4);
4133  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4134  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4135  __Pyx_GOTREF(__pyx_t_1);
4136  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4137  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4138  __pyx_v_nnz = __pyx_t_1;
4139  __pyx_t_1 = 0;
4140 
4141  /* "superluWrappers.pyx":94
4142  * nnz = self.rowptr[range_end] - self.rowptr[range_start]
4143  *
4144  * rowptr = self.rowptr[range_start : range_start + _rows + 1] # <<<<<<<<<<<<<<
4145  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4146  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4147  */
4148  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
4149  __Pyx_GOTREF(__pyx_t_1);
4150  __pyx_t_4 = PyNumber_Add(__pyx_v_range_start, __pyx_v__rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4151  __Pyx_GOTREF(__pyx_t_4);
4152  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
4153  __Pyx_GOTREF(__pyx_t_3);
4154  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4155  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, &__pyx_v_range_start, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4156  __Pyx_GOTREF(__pyx_t_4);
4157  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4158  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4159  __pyx_v_rowptr = __pyx_t_4;
4160  __pyx_t_4 = 0;
4161 
4162  /* "superluWrappers.pyx":95
4163  *
4164  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4165  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
4166  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4167  *
4168  */
4169  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
4170  __Pyx_GOTREF(__pyx_t_4);
4171  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4172  __Pyx_GOTREF(__pyx_t_3);
4173  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
4174  __Pyx_GOTREF(__pyx_t_1);
4175  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4176  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4177  __Pyx_GOTREF(__pyx_t_3);
4178  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4179  __Pyx_GOTREF(__pyx_t_5);
4180  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4181  __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4182  __Pyx_GOTREF(__pyx_t_3);
4183  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4184  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4185  __Pyx_GOTREF(__pyx_t_5);
4186  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4187  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4188  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4189  __pyx_v_colind = __pyx_t_5;
4190  __pyx_t_5 = 0;
4191 
4192  /* "superluWrappers.pyx":96
4193  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4194  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4195  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
4196  *
4197  * return rowptr, colind, nzvals
4198  */
4199  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
4200  __Pyx_GOTREF(__pyx_t_5);
4201  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4202  __Pyx_GOTREF(__pyx_t_3);
4203  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
4204  __Pyx_GOTREF(__pyx_t_1);
4205  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4206  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4207  __Pyx_GOTREF(__pyx_t_3);
4208  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4209  __Pyx_GOTREF(__pyx_t_4);
4210  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4211  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4212  __Pyx_GOTREF(__pyx_t_3);
4213  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4214  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4215  __Pyx_GOTREF(__pyx_t_4);
4216  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4217  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4218  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4219  __pyx_v_nzvals = __pyx_t_4;
4220  __pyx_t_4 = 0;
4221 
4222  /* "superluWrappers.pyx":98
4223  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4224  *
4225  * return rowptr, colind, nzvals # <<<<<<<<<<<<<<
4226  *
4227  * cdef class cSparseMatrix(object):
4228  */
4229  __Pyx_XDECREF(__pyx_r);
4230  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
4231  __Pyx_GOTREF(__pyx_t_4);
4232  __Pyx_INCREF(__pyx_v_rowptr);
4233  __Pyx_GIVEREF(__pyx_v_rowptr);
4234  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rowptr);
4235  __Pyx_INCREF(__pyx_v_colind);
4236  __Pyx_GIVEREF(__pyx_v_colind);
4237  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_colind);
4238  __Pyx_INCREF(__pyx_v_nzvals);
4239  __Pyx_GIVEREF(__pyx_v_nzvals);
4240  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nzvals);
4241  __pyx_r = __pyx_t_4;
4242  __pyx_t_4 = 0;
4243  goto __pyx_L0;
4244 
4245  /* "superluWrappers.pyx":72
4246  * return (self.rowptr, self.colind, self.nzvals)
4247  *
4248  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
4249  * range_start,
4250  * range_end):
4251  */
4252 
4253  /* function exit code */
4254  __pyx_L1_error:;
4255  __Pyx_XDECREF(__pyx_t_1);
4256  __Pyx_XDECREF(__pyx_t_3);
4257  __Pyx_XDECREF(__pyx_t_4);
4258  __Pyx_XDECREF(__pyx_t_5);
4259  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
4260  __pyx_r = NULL;
4261  __pyx_L0:;
4262  __Pyx_XDECREF(__pyx_v__rows);
4263  __Pyx_XDECREF(__pyx_v_nnz);
4264  __Pyx_XDECREF(__pyx_v_rowptr);
4265  __Pyx_XDECREF(__pyx_v_colind);
4266  __Pyx_XDECREF(__pyx_v_nzvals);
4267  __Pyx_XGIVEREF(__pyx_r);
4268  __Pyx_RefNannyFinishContext();
4269  return __pyx_r;
4270 }
4271 
4272 /* "superluWrappers.pyx":102
4273  * cdef class cSparseMatrix(object):
4274  *
4275  * def __cinit__(self, # <<<<<<<<<<<<<<
4276  * int nr,
4277  * int nc,
4278  */
4279 
4280 /* Python wrapper */
4281 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4282 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4283  int __pyx_v_nr;
4284  int __pyx_v_nc;
4285  int __pyx_v_nnz;
4286  __Pyx_memviewslice __pyx_v_nzval = { 0, 0, { 0 }, { 0 }, { 0 } };
4287  __Pyx_memviewslice __pyx_v_colind = { 0, 0, { 0 }, { 0 }, { 0 } };
4288  __Pyx_memviewslice __pyx_v_rowptr = { 0, 0, { 0 }, { 0 }, { 0 } };
4289  int __pyx_lineno = 0;
4290  const char *__pyx_filename = NULL;
4291  int __pyx_clineno = 0;
4292  int __pyx_r;
4293  __Pyx_RefNannyDeclarations
4294  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4295  {
4296  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzval,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
4297  PyObject* values[6] = {0,0,0,0,0,0};
4298  if (unlikely(__pyx_kwds)) {
4299  Py_ssize_t kw_args;
4300  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4301  switch (pos_args) {
4302  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4303  CYTHON_FALLTHROUGH;
4304  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4305  CYTHON_FALLTHROUGH;
4306  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4307  CYTHON_FALLTHROUGH;
4308  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4309  CYTHON_FALLTHROUGH;
4310  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4311  CYTHON_FALLTHROUGH;
4312  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4313  CYTHON_FALLTHROUGH;
4314  case 0: break;
4315  default: goto __pyx_L5_argtuple_error;
4316  }
4317  kw_args = PyDict_Size(__pyx_kwds);
4318  switch (pos_args) {
4319  case 0:
4320  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
4321  else goto __pyx_L5_argtuple_error;
4322  CYTHON_FALLTHROUGH;
4323  case 1:
4324  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
4325  else {
4326  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); __PYX_ERR(0, 102, __pyx_L3_error)
4327  }
4328  CYTHON_FALLTHROUGH;
4329  case 2:
4330  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
4331  else {
4332  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); __PYX_ERR(0, 102, __pyx_L3_error)
4333  }
4334  CYTHON_FALLTHROUGH;
4335  case 3:
4336  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzval)) != 0)) kw_args--;
4337  else {
4338  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); __PYX_ERR(0, 102, __pyx_L3_error)
4339  }
4340  CYTHON_FALLTHROUGH;
4341  case 4:
4342  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
4343  else {
4344  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); __PYX_ERR(0, 102, __pyx_L3_error)
4345  }
4346  CYTHON_FALLTHROUGH;
4347  case 5:
4348  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
4349  else {
4350  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); __PYX_ERR(0, 102, __pyx_L3_error)
4351  }
4352  }
4353  if (unlikely(kw_args > 0)) {
4354  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
4355  }
4356  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4357  goto __pyx_L5_argtuple_error;
4358  } else {
4359  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4360  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4361  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4362  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4363  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4364  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4365  }
4366  __pyx_v_nr = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_nr == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
4367  __pyx_v_nc = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
4368  __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error)
4369  __pyx_v_nzval = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nzval.memview)) __PYX_ERR(0, 106, __pyx_L3_error)
4370  __pyx_v_colind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_colind.memview)) __PYX_ERR(0, 107, __pyx_L3_error)
4371  __pyx_v_rowptr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_rowptr.memview)) __PYX_ERR(0, 108, __pyx_L3_error)
4372  }
4373  goto __pyx_L4_argument_unpacking_done;
4374  __pyx_L5_argtuple_error:;
4375  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
4376  __pyx_L3_error:;
4377  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4378  __Pyx_RefNannyFinishContext();
4379  return -1;
4380  __pyx_L4_argument_unpacking_done:;
4381  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzval, __pyx_v_colind, __pyx_v_rowptr);
4382 
4383  /* function exit code */
4384  __Pyx_RefNannyFinishContext();
4385  return __pyx_r;
4386 }
4387 
4388 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, int __pyx_v_nr, int __pyx_v_nc, int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr) {
4389  int __pyx_r;
4390  __Pyx_RefNannyDeclarations
4391  Py_ssize_t __pyx_t_1;
4392  __Pyx_RefNannySetupContext("__cinit__", 0);
4393 
4394  /* "superluWrappers.pyx":109
4395  * np.int32_t [:] colind,
4396  * np.int32_t [:] rowptr):
4397  * self.dim[0] = nr ; self.dim[1] = nc # <<<<<<<<<<<<<<
4398  * self.A.nnz = nnz
4399  * #ARB - should memory for these ptrs need be allocated?
4400  */
4401  (__pyx_v_self->dim[0]) = __pyx_v_nr;
4402  (__pyx_v_self->dim[1]) = __pyx_v_nc;
4403 
4404  /* "superluWrappers.pyx":110
4405  * np.int32_t [:] rowptr):
4406  * self.dim[0] = nr ; self.dim[1] = nc
4407  * self.A.nnz = nnz # <<<<<<<<<<<<<<
4408  * #ARB - should memory for these ptrs need be allocated?
4409  * self.A.nzval = &nzval[0]
4410  */
4411  __pyx_v_self->A.nnz = __pyx_v_nnz;
4412 
4413  /* "superluWrappers.pyx":112
4414  * self.A.nnz = nnz
4415  * #ARB - should memory for these ptrs need be allocated?
4416  * self.A.nzval = &nzval[0] # <<<<<<<<<<<<<<
4417  * self.A.colind = &colind[0]
4418  * self.A.rowptr = &rowptr[0]
4419  */
4420  __pyx_t_1 = 0;
4421  __pyx_v_self->A.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_nzval.data + __pyx_t_1 * __pyx_v_nzval.strides[0]) ))));
4422 
4423  /* "superluWrappers.pyx":113
4424  * #ARB - should memory for these ptrs need be allocated?
4425  * self.A.nzval = &nzval[0]
4426  * self.A.colind = &colind[0] # <<<<<<<<<<<<<<
4427  * self.A.rowptr = &rowptr[0]
4428  *
4429  */
4430  __pyx_t_1 = 0;
4431  __pyx_v_self->A.colind = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_colind.data + __pyx_t_1 * __pyx_v_colind.strides[0]) ))));
4432 
4433  /* "superluWrappers.pyx":114
4434  * self.A.nzval = &nzval[0]
4435  * self.A.colind = &colind[0]
4436  * self.A.rowptr = &rowptr[0] # <<<<<<<<<<<<<<
4437  *
4438  * cdef void SparseMatrix_matvec(cSparseMatrix sm,
4439  */
4440  __pyx_t_1 = 0;
4441  __pyx_v_self->A.rowptr = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_rowptr.data + __pyx_t_1 * __pyx_v_rowptr.strides[0]) ))));
4442 
4443  /* "superluWrappers.pyx":102
4444  * cdef class cSparseMatrix(object):
4445  *
4446  * def __cinit__(self, # <<<<<<<<<<<<<<
4447  * int nr,
4448  * int nc,
4449  */
4450 
4451  /* function exit code */
4452  __pyx_r = 0;
4453  __PYX_XDEC_MEMVIEW(&__pyx_v_nzval, 1);
4454  __PYX_XDEC_MEMVIEW(&__pyx_v_colind, 1);
4455  __PYX_XDEC_MEMVIEW(&__pyx_v_rowptr, 1);
4456  __Pyx_RefNannyFinishContext();
4457  return __pyx_r;
4458 }
4459 
4460 /* "(tree fragment)":1
4461  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4462  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4463  * def __setstate_cython__(self, __pyx_state):
4464  */
4465 
4466 /* Python wrapper */
4467 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4468 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4469  PyObject *__pyx_r = 0;
4470  __Pyx_RefNannyDeclarations
4471  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4472  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self));
4473 
4474  /* function exit code */
4475  __Pyx_RefNannyFinishContext();
4476  return __pyx_r;
4477 }
4478 
4479 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self) {
4480  PyObject *__pyx_r = NULL;
4481  __Pyx_RefNannyDeclarations
4482  PyObject *__pyx_t_1 = NULL;
4483  int __pyx_lineno = 0;
4484  const char *__pyx_filename = NULL;
4485  int __pyx_clineno = 0;
4486  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4487 
4488  /* "(tree fragment)":2
4489  * def __reduce_cython__(self):
4490  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4491  * def __setstate_cython__(self, __pyx_state):
4492  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4493  */
4494  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
4495  __Pyx_GOTREF(__pyx_t_1);
4496  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4497  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4498  __PYX_ERR(1, 2, __pyx_L1_error)
4499 
4500  /* "(tree fragment)":1
4501  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4502  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4503  * def __setstate_cython__(self, __pyx_state):
4504  */
4505 
4506  /* function exit code */
4507  __pyx_L1_error:;
4508  __Pyx_XDECREF(__pyx_t_1);
4509  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4510  __pyx_r = NULL;
4511  __Pyx_XGIVEREF(__pyx_r);
4512  __Pyx_RefNannyFinishContext();
4513  return __pyx_r;
4514 }
4515 
4516 /* "(tree fragment)":3
4517  * def __reduce_cython__(self):
4518  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4519  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4520  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4521  */
4522 
4523 /* Python wrapper */
4524 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4525 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4526  PyObject *__pyx_r = 0;
4527  __Pyx_RefNannyDeclarations
4528  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4529  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4530 
4531  /* function exit code */
4532  __Pyx_RefNannyFinishContext();
4533  return __pyx_r;
4534 }
4535 
4536 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4537  PyObject *__pyx_r = NULL;
4538  __Pyx_RefNannyDeclarations
4539  PyObject *__pyx_t_1 = NULL;
4540  int __pyx_lineno = 0;
4541  const char *__pyx_filename = NULL;
4542  int __pyx_clineno = 0;
4543  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4544 
4545  /* "(tree fragment)":4
4546  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4547  * def __setstate_cython__(self, __pyx_state):
4548  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4549  */
4550  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
4551  __Pyx_GOTREF(__pyx_t_1);
4552  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4553  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4554  __PYX_ERR(1, 4, __pyx_L1_error)
4555 
4556  /* "(tree fragment)":3
4557  * def __reduce_cython__(self):
4558  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4559  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4560  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4561  */
4562 
4563  /* function exit code */
4564  __pyx_L1_error:;
4565  __Pyx_XDECREF(__pyx_t_1);
4566  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4567  __pyx_r = NULL;
4568  __Pyx_XGIVEREF(__pyx_r);
4569  __Pyx_RefNannyFinishContext();
4570  return __pyx_r;
4571 }
4572 
4573 /* "superluWrappers.pyx":116
4574  * self.A.rowptr = &rowptr[0]
4575  *
4576  * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
4577  * np.float64_t [:] xp,
4578  * np.float64_t [:] yp):
4579  */
4580 
4581 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, __Pyx_memviewslice __pyx_v_xp, __Pyx_memviewslice __pyx_v_yp) {
4582  __pyx_t_5numpy_float64_t __pyx_v_tmp;
4583  int __pyx_v_i;
4584  int __pyx_v_k;
4585  __Pyx_RefNannyDeclarations
4586  __pyx_t_5numpy_int32_t __pyx_t_1;
4587  __pyx_t_5numpy_int32_t __pyx_t_2;
4588  int __pyx_t_3;
4589  __pyx_t_5numpy_int32_t __pyx_t_4;
4590  __pyx_t_5numpy_int32_t __pyx_t_5;
4591  int __pyx_t_6;
4592  Py_ssize_t __pyx_t_7;
4593  __Pyx_RefNannySetupContext("SparseMatrix_matvec", 0);
4594 
4595  /* "superluWrappers.pyx":119
4596  * np.float64_t [:] xp,
4597  * np.float64_t [:] yp):
4598  * cdef np.float64_t tmp = 0. # <<<<<<<<<<<<<<
4599  * cdef int i, k
4600  *
4601  */
4602  __pyx_v_tmp = 0.;
4603 
4604  /* "superluWrappers.pyx":122
4605  * cdef int i, k
4606  *
4607  * for i in range(sm.dim[0]): # <<<<<<<<<<<<<<
4608  * tmp = 0.
4609  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4610  */
4611  __pyx_t_1 = (__pyx_v_sm->dim[0]);
4612  __pyx_t_2 = __pyx_t_1;
4613  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4614  __pyx_v_i = __pyx_t_3;
4615 
4616  /* "superluWrappers.pyx":123
4617  *
4618  * for i in range(sm.dim[0]):
4619  * tmp = 0. # <<<<<<<<<<<<<<
4620  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4621  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4622  */
4623  __pyx_v_tmp = 0.;
4624 
4625  /* "superluWrappers.pyx":124
4626  * for i in range(sm.dim[0]):
4627  * tmp = 0.
4628  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]): # <<<<<<<<<<<<<<
4629  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4630  * yp[i] = tmp
4631  */
4632  __pyx_t_4 = (__pyx_v_sm->A.rowptr[(__pyx_v_i + 1)]);
4633  __pyx_t_5 = __pyx_t_4;
4634  for (__pyx_t_6 = (__pyx_v_sm->A.rowptr[__pyx_v_i]); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4635  __pyx_v_k = __pyx_t_6;
4636 
4637  /* "superluWrappers.pyx":125
4638  * tmp = 0.
4639  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4640  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]] # <<<<<<<<<<<<<<
4641  * yp[i] = tmp
4642  *
4643  */
4644  __pyx_t_7 = (__pyx_v_sm->A.colind[__pyx_v_k]);
4645  __pyx_v_tmp = (__pyx_v_tmp + ((__pyx_v_sm->A.nzval[__pyx_v_k]) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_xp.data + __pyx_t_7 * __pyx_v_xp.strides[0]) )))));
4646  }
4647 
4648  /* "superluWrappers.pyx":126
4649  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4650  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4651  * yp[i] = tmp # <<<<<<<<<<<<<<
4652  *
4653  * cdef struct _NCformat:
4654  */
4655  __pyx_t_7 = __pyx_v_i;
4656  *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_yp.data + __pyx_t_7 * __pyx_v_yp.strides[0]) )) = __pyx_v_tmp;
4657  }
4658 
4659  /* "superluWrappers.pyx":116
4660  * self.A.rowptr = &rowptr[0]
4661  *
4662  * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
4663  * np.float64_t [:] xp,
4664  * np.float64_t [:] yp):
4665  */
4666 
4667  /* function exit code */
4668  __Pyx_RefNannyFinishContext();
4669 }
4670 
4671 /* "superluWrappers.pyx":170
4672  * cdef public int dim
4673  *
4674  * def __init__(self, dim): # <<<<<<<<<<<<<<
4675  * """
4676  * Arguments
4677  */
4678 
4679 /* Python wrapper */
4680 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4681 static char __pyx_doc_15superluWrappers_12SparseFactor___init__[] = "\n Arguments\n ---------\n dim : int\n Dimension of the sparse factor.\n ";
4682 #if CYTHON_COMPILING_IN_CPYTHON
4683 struct wrapperbase __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
4684 #endif
4685 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4686  PyObject *__pyx_v_dim = 0;
4687  int __pyx_lineno = 0;
4688  const char *__pyx_filename = NULL;
4689  int __pyx_clineno = 0;
4690  int __pyx_r;
4691  __Pyx_RefNannyDeclarations
4692  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4693  {
4694  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0};
4695  PyObject* values[1] = {0};
4696  if (unlikely(__pyx_kwds)) {
4697  Py_ssize_t kw_args;
4698  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4699  switch (pos_args) {
4700  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4701  CYTHON_FALLTHROUGH;
4702  case 0: break;
4703  default: goto __pyx_L5_argtuple_error;
4704  }
4705  kw_args = PyDict_Size(__pyx_kwds);
4706  switch (pos_args) {
4707  case 0:
4708  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
4709  else goto __pyx_L5_argtuple_error;
4710  }
4711  if (unlikely(kw_args > 0)) {
4712  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 170, __pyx_L3_error)
4713  }
4714  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
4715  goto __pyx_L5_argtuple_error;
4716  } else {
4717  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4718  }
4719  __pyx_v_dim = values[0];
4720  }
4721  goto __pyx_L4_argument_unpacking_done;
4722  __pyx_L5_argtuple_error:;
4723  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 170, __pyx_L3_error)
4724  __pyx_L3_error:;
4725  __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4726  __Pyx_RefNannyFinishContext();
4727  return -1;
4728  __pyx_L4_argument_unpacking_done:;
4729  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor___init__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), __pyx_v_dim);
4730 
4731  /* function exit code */
4732  __Pyx_RefNannyFinishContext();
4733  return __pyx_r;
4734 }
4735 
4736 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim) {
4737  int __pyx_r;
4738  __Pyx_RefNannyDeclarations
4739  PyObject *__pyx_t_1 = NULL;
4740  int __pyx_t_2;
4741  __pyx_t_5numpy_int32_t __pyx_t_3;
4742  PyObject *__pyx_t_4 = NULL;
4743  size_t __pyx_t_5;
4744  int __pyx_lineno = 0;
4745  const char *__pyx_filename = NULL;
4746  int __pyx_clineno = 0;
4747  __Pyx_RefNannySetupContext("__init__", 0);
4748 
4749  /* "superluWrappers.pyx":177
4750  * Dimension of the sparse factor.
4751  * """
4752  * cStatInit(&self.stat) # <<<<<<<<<<<<<<
4753  * cset_default_options(&self.options)
4754  * self._set_mat_types()
4755  */
4756  StatInit((&__pyx_v_self->stat));
4757 
4758  /* "superluWrappers.pyx":178
4759  * """
4760  * cStatInit(&self.stat)
4761  * cset_default_options(&self.options) # <<<<<<<<<<<<<<
4762  * self._set_mat_types()
4763  * self.dim = dim
4764  */
4765  set_default_options((&__pyx_v_self->options));
4766 
4767  /* "superluWrappers.pyx":179
4768  * cStatInit(&self.stat)
4769  * cset_default_options(&self.options)
4770  * self._set_mat_types() # <<<<<<<<<<<<<<
4771  * self.dim = dim
4772  * self.A.nrow = dim ; self.A.ncol = dim
4773  */
4774  __pyx_t_1 = ((struct __pyx_vtabstruct_15superluWrappers_SparseFactor *)__pyx_v_self->__pyx_vtab)->_set_mat_types(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
4775  __Pyx_GOTREF(__pyx_t_1);
4776  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4777 
4778  /* "superluWrappers.pyx":180
4779  * cset_default_options(&self.options)
4780  * self._set_mat_types()
4781  * self.dim = dim # <<<<<<<<<<<<<<
4782  * self.A.nrow = dim ; self.A.ncol = dim
4783  * self.AC.nrow = dim ; self.AC.ncol = dim
4784  */
4785  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
4786  __pyx_v_self->dim = __pyx_t_2;
4787 
4788  /* "superluWrappers.pyx":181
4789  * self._set_mat_types()
4790  * self.dim = dim
4791  * self.A.nrow = dim ; self.A.ncol = dim # <<<<<<<<<<<<<<
4792  * self.AC.nrow = dim ; self.AC.ncol = dim
4793  * self.L.nrow = dim ; self.L.ncol = dim
4794  */
4795  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4796  __pyx_v_self->A.nrow = __pyx_t_2;
4797  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4798  __pyx_v_self->A.ncol = __pyx_t_2;
4799 
4800  /* "superluWrappers.pyx":182
4801  * self.dim = dim
4802  * self.A.nrow = dim ; self.A.ncol = dim
4803  * self.AC.nrow = dim ; self.AC.ncol = dim # <<<<<<<<<<<<<<
4804  * self.L.nrow = dim ; self.L.ncol = dim
4805  * self.U.nrow = dim ; self.U.ncol = dim
4806  */
4807  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4808  __pyx_v_self->AC.nrow = __pyx_t_2;
4809  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4810  __pyx_v_self->AC.ncol = __pyx_t_2;
4811 
4812  /* "superluWrappers.pyx":183
4813  * self.A.nrow = dim ; self.A.ncol = dim
4814  * self.AC.nrow = dim ; self.AC.ncol = dim
4815  * self.L.nrow = dim ; self.L.ncol = dim # <<<<<<<<<<<<<<
4816  * self.U.nrow = dim ; self.U.ncol = dim
4817  * self.X.nrow = dim ; self.X.ncol = 1
4818  */
4819  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4820  __pyx_v_self->L.nrow = __pyx_t_2;
4821  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4822  __pyx_v_self->L.ncol = __pyx_t_2;
4823 
4824  /* "superluWrappers.pyx":184
4825  * self.AC.nrow = dim ; self.AC.ncol = dim
4826  * self.L.nrow = dim ; self.L.ncol = dim
4827  * self.U.nrow = dim ; self.U.ncol = dim # <<<<<<<<<<<<<<
4828  * self.X.nrow = dim ; self.X.ncol = 1
4829  * self.storeX.lda = dim
4830  */
4831  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4832  __pyx_v_self->U.nrow = __pyx_t_2;
4833  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4834  __pyx_v_self->U.ncol = __pyx_t_2;
4835 
4836  /* "superluWrappers.pyx":185
4837  * self.L.nrow = dim ; self.L.ncol = dim
4838  * self.U.nrow = dim ; self.U.ncol = dim
4839  * self.X.nrow = dim ; self.X.ncol = 1 # <<<<<<<<<<<<<<
4840  * self.storeX.lda = dim
4841  * self.use_same_perm_c = 0
4842  */
4843  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4844  __pyx_v_self->X.nrow = __pyx_t_2;
4845  __pyx_v_self->X.ncol = 1;
4846 
4847  /* "superluWrappers.pyx":186
4848  * self.U.nrow = dim ; self.U.ncol = dim
4849  * self.X.nrow = dim ; self.X.ncol = 1
4850  * self.storeX.lda = dim # <<<<<<<<<<<<<<
4851  * self.use_same_perm_c = 0
4852  * self.use_same_sparsity = 0
4853  */
4854  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_v_dim); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4855  __pyx_v_self->storeX.lda = __pyx_t_3;
4856 
4857  /* "superluWrappers.pyx":187
4858  * self.X.nrow = dim ; self.X.ncol = 1
4859  * self.storeX.lda = dim
4860  * self.use_same_perm_c = 0 # <<<<<<<<<<<<<<
4861  * self.use_same_sparsity = 0
4862  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4863  */
4864  __pyx_v_self->use_same_perm_c = 0;
4865 
4866  /* "superluWrappers.pyx":188
4867  * self.storeX.lda = dim
4868  * self.use_same_perm_c = 0
4869  * self.use_same_sparsity = 0 # <<<<<<<<<<<<<<
4870  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4871  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4872  */
4873  __pyx_v_self->use_same_sparsity = 0;
4874 
4875  /* "superluWrappers.pyx":189
4876  * self.use_same_perm_c = 0
4877  * self.use_same_sparsity = 0
4878  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4879  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4880  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4881  */
4882  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
4883  __Pyx_GOTREF(__pyx_t_1);
4884  __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
4885  __Pyx_GOTREF(__pyx_t_4);
4886  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4887  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
4888  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4889  __pyx_v_self->perm_c = ((int *)malloc(__pyx_t_5));
4890 
4891  /* "superluWrappers.pyx":190
4892  * self.use_same_sparsity = 0
4893  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4894  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4895  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4896  *
4897  */
4898  __pyx_t_4 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
4899  __Pyx_GOTREF(__pyx_t_4);
4900  __pyx_t_1 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
4901  __Pyx_GOTREF(__pyx_t_1);
4902  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4903  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L1_error)
4904  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4905  __pyx_v_self->perm_r = ((int *)malloc(__pyx_t_5));
4906 
4907  /* "superluWrappers.pyx":191
4908  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4909  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4910  * self.etree = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4911  *
4912  * cdef _set_mat_types(self):
4913  */
4914  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
4915  __Pyx_GOTREF(__pyx_t_1);
4916  __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
4917  __Pyx_GOTREF(__pyx_t_4);
4918  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4919  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L1_error)
4920  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4921  __pyx_v_self->etree = ((int *)malloc(__pyx_t_5));
4922 
4923  /* "superluWrappers.pyx":170
4924  * cdef public int dim
4925  *
4926  * def __init__(self, dim): # <<<<<<<<<<<<<<
4927  * """
4928  * Arguments
4929  */
4930 
4931  /* function exit code */
4932  __pyx_r = 0;
4933  goto __pyx_L0;
4934  __pyx_L1_error:;
4935  __Pyx_XDECREF(__pyx_t_1);
4936  __Pyx_XDECREF(__pyx_t_4);
4937  __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4938  __pyx_r = -1;
4939  __pyx_L0:;
4940  __Pyx_RefNannyFinishContext();
4941  return __pyx_r;
4942 }
4943 
4944 /* "superluWrappers.pyx":193
4945  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4946  *
4947  * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
4948  * self.A.Stype = _SLU_NC
4949  * self.A.Dtype = _SLU_D
4950  */
4951 
4952 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
4953  PyObject *__pyx_r = NULL;
4954  __Pyx_RefNannyDeclarations
4955  __Pyx_RefNannySetupContext("_set_mat_types", 0);
4956 
4957  /* "superluWrappers.pyx":194
4958  *
4959  * cdef _set_mat_types(self):
4960  * self.A.Stype = _SLU_NC # <<<<<<<<<<<<<<
4961  * self.A.Dtype = _SLU_D
4962  * self.A.Mtype = _SLU_GE
4963  */
4964  __pyx_v_self->A.Stype = SLU_NC;
4965 
4966  /* "superluWrappers.pyx":195
4967  * cdef _set_mat_types(self):
4968  * self.A.Stype = _SLU_NC
4969  * self.A.Dtype = _SLU_D # <<<<<<<<<<<<<<
4970  * self.A.Mtype = _SLU_GE
4971  * self.A.Store = &self.storeA
4972  */
4973  __pyx_v_self->A.Dtype = SLU_D;
4974 
4975  /* "superluWrappers.pyx":196
4976  * self.A.Stype = _SLU_NC
4977  * self.A.Dtype = _SLU_D
4978  * self.A.Mtype = _SLU_GE # <<<<<<<<<<<<<<
4979  * self.A.Store = &self.storeA
4980  *
4981  */
4982  __pyx_v_self->A.Mtype = SLU_GE;
4983 
4984  /* "superluWrappers.pyx":197
4985  * self.A.Dtype = _SLU_D
4986  * self.A.Mtype = _SLU_GE
4987  * self.A.Store = &self.storeA # <<<<<<<<<<<<<<
4988  *
4989  * self.AC.Stype = _SLU_NCP
4990  */
4991  __pyx_v_self->A.Store = (&__pyx_v_self->storeA);
4992 
4993  /* "superluWrappers.pyx":199
4994  * self.A.Store = &self.storeA
4995  *
4996  * self.AC.Stype = _SLU_NCP # <<<<<<<<<<<<<<
4997  * self.AC.Dtype = _SLU_D
4998  * self.AC.Mtype = _SLU_GE
4999  */
5000  __pyx_v_self->AC.Stype = SLU_NCP;
5001 
5002  /* "superluWrappers.pyx":200
5003  *
5004  * self.AC.Stype = _SLU_NCP
5005  * self.AC.Dtype = _SLU_D # <<<<<<<<<<<<<<
5006  * self.AC.Mtype = _SLU_GE
5007  * self.AC.Store = NULL
5008  */
5009  __pyx_v_self->AC.Dtype = SLU_D;
5010 
5011  /* "superluWrappers.pyx":201
5012  * self.AC.Stype = _SLU_NCP
5013  * self.AC.Dtype = _SLU_D
5014  * self.AC.Mtype = _SLU_GE # <<<<<<<<<<<<<<
5015  * self.AC.Store = NULL
5016  *
5017  */
5018  __pyx_v_self->AC.Mtype = SLU_GE;
5019 
5020  /* "superluWrappers.pyx":202
5021  * self.AC.Dtype = _SLU_D
5022  * self.AC.Mtype = _SLU_GE
5023  * self.AC.Store = NULL # <<<<<<<<<<<<<<
5024  *
5025  * self.L.Stype = _SLU_NC
5026  */
5027  __pyx_v_self->AC.Store = NULL;
5028 
5029  /* "superluWrappers.pyx":204
5030  * self.AC.Store = NULL
5031  *
5032  * self.L.Stype = _SLU_NC # <<<<<<<<<<<<<<
5033  * self.L.Dtype = _SLU_D
5034  * self.L.Mtype = _SLU_TRLU
5035  */
5036  __pyx_v_self->L.Stype = SLU_NC;
5037 
5038  /* "superluWrappers.pyx":205
5039  *
5040  * self.L.Stype = _SLU_NC
5041  * self.L.Dtype = _SLU_D # <<<<<<<<<<<<<<
5042  * self.L.Mtype = _SLU_TRLU
5043  * self.L.Store = NULL
5044  */
5045  __pyx_v_self->L.Dtype = SLU_D;
5046 
5047  /* "superluWrappers.pyx":206
5048  * self.L.Stype = _SLU_NC
5049  * self.L.Dtype = _SLU_D
5050  * self.L.Mtype = _SLU_TRLU # <<<<<<<<<<<<<<
5051  * self.L.Store = NULL
5052  *
5053  */
5054  __pyx_v_self->L.Mtype = SLU_TRLU;
5055 
5056  /* "superluWrappers.pyx":207
5057  * self.L.Dtype = _SLU_D
5058  * self.L.Mtype = _SLU_TRLU
5059  * self.L.Store = NULL # <<<<<<<<<<<<<<
5060  *
5061  * self.U.Stype = _SLU_NC
5062  */
5063  __pyx_v_self->L.Store = NULL;
5064 
5065  /* "superluWrappers.pyx":209
5066  * self.L.Store = NULL
5067  *
5068  * self.U.Stype = _SLU_NC # <<<<<<<<<<<<<<
5069  * self.U.Dtype = _SLU_D
5070  * self.U.Mtype = _SLU_TRU
5071  */
5072  __pyx_v_self->U.Stype = SLU_NC;
5073 
5074  /* "superluWrappers.pyx":210
5075  *
5076  * self.U.Stype = _SLU_NC
5077  * self.U.Dtype = _SLU_D # <<<<<<<<<<<<<<
5078  * self.U.Mtype = _SLU_TRU
5079  * self.U.Store = NULL
5080  */
5081  __pyx_v_self->U.Dtype = SLU_D;
5082 
5083  /* "superluWrappers.pyx":211
5084  * self.U.Stype = _SLU_NC
5085  * self.U.Dtype = _SLU_D
5086  * self.U.Mtype = _SLU_TRU # <<<<<<<<<<<<<<
5087  * self.U.Store = NULL
5088  *
5089  */
5090  __pyx_v_self->U.Mtype = SLU_TRU;
5091 
5092  /* "superluWrappers.pyx":212
5093  * self.U.Dtype = _SLU_D
5094  * self.U.Mtype = _SLU_TRU
5095  * self.U.Store = NULL # <<<<<<<<<<<<<<
5096  *
5097  * self.X.Stype = _SLU_DN
5098  */
5099  __pyx_v_self->U.Store = NULL;
5100 
5101  /* "superluWrappers.pyx":214
5102  * self.U.Store = NULL
5103  *
5104  * self.X.Stype = _SLU_DN # <<<<<<<<<<<<<<
5105  * self.X.Dtype = _SLU_D
5106  * self.X.Mtype = _SLU_GE
5107  */
5108  __pyx_v_self->X.Stype = SLU_DN;
5109 
5110  /* "superluWrappers.pyx":215
5111  *
5112  * self.X.Stype = _SLU_DN
5113  * self.X.Dtype = _SLU_D # <<<<<<<<<<<<<<
5114  * self.X.Mtype = _SLU_GE
5115  * self.X.Store = &self.storeX
5116  */
5117  __pyx_v_self->X.Dtype = SLU_D;
5118 
5119  /* "superluWrappers.pyx":216
5120  * self.X.Stype = _SLU_DN
5121  * self.X.Dtype = _SLU_D
5122  * self.X.Mtype = _SLU_GE # <<<<<<<<<<<<<<
5123  * self.X.Store = &self.storeX
5124  *
5125  */
5126  __pyx_v_self->X.Mtype = SLU_GE;
5127 
5128  /* "superluWrappers.pyx":217
5129  * self.X.Dtype = _SLU_D
5130  * self.X.Mtype = _SLU_GE
5131  * self.X.Store = &self.storeX # <<<<<<<<<<<<<<
5132  *
5133  * def sparseFactorPrepare(sparse_matrix,
5134  */
5135  __pyx_v_self->X.Store = (&__pyx_v_self->storeX);
5136 
5137  /* "superluWrappers.pyx":193
5138  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
5139  *
5140  * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
5141  * self.A.Stype = _SLU_NC
5142  * self.A.Dtype = _SLU_D
5143  */
5144 
5145  /* function exit code */
5146  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5147  __Pyx_XGIVEREF(__pyx_r);
5148  __Pyx_RefNannyFinishContext();
5149  return __pyx_r;
5150 }
5151 
5152 /* "superluWrappers.pyx":168
5153  * cdef unsigned int use_same_sparsity
5154  *
5155  * cdef public int dim # <<<<<<<<<<<<<<
5156  *
5157  * def __init__(self, dim):
5158  */
5159 
5160 /* Python wrapper */
5161 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self); /*proto*/
5162 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self) {
5163  PyObject *__pyx_r = 0;
5164  __Pyx_RefNannyDeclarations
5165  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5166  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5167 
5168  /* function exit code */
5169  __Pyx_RefNannyFinishContext();
5170  return __pyx_r;
5171 }
5172 
5173 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5174  PyObject *__pyx_r = NULL;
5175  __Pyx_RefNannyDeclarations
5176  PyObject *__pyx_t_1 = NULL;
5177  int __pyx_lineno = 0;
5178  const char *__pyx_filename = NULL;
5179  int __pyx_clineno = 0;
5180  __Pyx_RefNannySetupContext("__get__", 0);
5181  __Pyx_XDECREF(__pyx_r);
5182  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
5183  __Pyx_GOTREF(__pyx_t_1);
5184  __pyx_r = __pyx_t_1;
5185  __pyx_t_1 = 0;
5186  goto __pyx_L0;
5187 
5188  /* function exit code */
5189  __pyx_L1_error:;
5190  __Pyx_XDECREF(__pyx_t_1);
5191  __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5192  __pyx_r = NULL;
5193  __pyx_L0:;
5194  __Pyx_XGIVEREF(__pyx_r);
5195  __Pyx_RefNannyFinishContext();
5196  return __pyx_r;
5197 }
5198 
5199 /* Python wrapper */
5200 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
5201 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5202  int __pyx_r;
5203  __Pyx_RefNannyDeclarations
5204  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5205  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5206 
5207  /* function exit code */
5208  __Pyx_RefNannyFinishContext();
5209  return __pyx_r;
5210 }
5211 
5212 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value) {
5213  int __pyx_r;
5214  __Pyx_RefNannyDeclarations
5215  int __pyx_t_1;
5216  int __pyx_lineno = 0;
5217  const char *__pyx_filename = NULL;
5218  int __pyx_clineno = 0;
5219  __Pyx_RefNannySetupContext("__set__", 0);
5220  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
5221  __pyx_v_self->dim = __pyx_t_1;
5222 
5223  /* function exit code */
5224  __pyx_r = 0;
5225  goto __pyx_L0;
5226  __pyx_L1_error:;
5227  __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5228  __pyx_r = -1;
5229  __pyx_L0:;
5230  __Pyx_RefNannyFinishContext();
5231  return __pyx_r;
5232 }
5233 
5234 /* "(tree fragment)":1
5235  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5236  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5237  * def __setstate_cython__(self, __pyx_state):
5238  */
5239 
5240 /* Python wrapper */
5241 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5242 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5243  PyObject *__pyx_r = 0;
5244  __Pyx_RefNannyDeclarations
5245  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5246  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5247 
5248  /* function exit code */
5249  __Pyx_RefNannyFinishContext();
5250  return __pyx_r;
5251 }
5252 
5253 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5254  PyObject *__pyx_r = NULL;
5255  __Pyx_RefNannyDeclarations
5256  PyObject *__pyx_t_1 = NULL;
5257  int __pyx_lineno = 0;
5258  const char *__pyx_filename = NULL;
5259  int __pyx_clineno = 0;
5260  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5261 
5262  /* "(tree fragment)":2
5263  * def __reduce_cython__(self):
5264  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5265  * def __setstate_cython__(self, __pyx_state):
5266  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5267  */
5268  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5269  __Pyx_GOTREF(__pyx_t_1);
5270  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5271  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5272  __PYX_ERR(1, 2, __pyx_L1_error)
5273 
5274  /* "(tree fragment)":1
5275  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5276  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5277  * def __setstate_cython__(self, __pyx_state):
5278  */
5279 
5280  /* function exit code */
5281  __pyx_L1_error:;
5282  __Pyx_XDECREF(__pyx_t_1);
5283  __Pyx_AddTraceback("superluWrappers.SparseFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5284  __pyx_r = NULL;
5285  __Pyx_XGIVEREF(__pyx_r);
5286  __Pyx_RefNannyFinishContext();
5287  return __pyx_r;
5288 }
5289 
5290 /* "(tree fragment)":3
5291  * def __reduce_cython__(self):
5292  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5293  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5294  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5295  */
5296 
5297 /* Python wrapper */
5298 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5299 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5300  PyObject *__pyx_r = 0;
5301  __Pyx_RefNannyDeclarations
5302  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5303  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5304 
5305  /* function exit code */
5306  __Pyx_RefNannyFinishContext();
5307  return __pyx_r;
5308 }
5309 
5310 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5311  PyObject *__pyx_r = NULL;
5312  __Pyx_RefNannyDeclarations
5313  PyObject *__pyx_t_1 = NULL;
5314  int __pyx_lineno = 0;
5315  const char *__pyx_filename = NULL;
5316  int __pyx_clineno = 0;
5317  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5318 
5319  /* "(tree fragment)":4
5320  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5321  * def __setstate_cython__(self, __pyx_state):
5322  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5323  */
5324  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5325  __Pyx_GOTREF(__pyx_t_1);
5326  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5327  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5328  __PYX_ERR(1, 4, __pyx_L1_error)
5329 
5330  /* "(tree fragment)":3
5331  * def __reduce_cython__(self):
5332  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5333  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5334  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5335  */
5336 
5337  /* function exit code */
5338  __pyx_L1_error:;
5339  __Pyx_XDECREF(__pyx_t_1);
5340  __Pyx_AddTraceback("superluWrappers.SparseFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5341  __pyx_r = NULL;
5342  __Pyx_XGIVEREF(__pyx_r);
5343  __Pyx_RefNannyFinishContext();
5344  return __pyx_r;
5345 }
5346 
5347 /* "superluWrappers.pyx":219
5348  * self.X.Store = &self.storeX
5349  *
5350  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
5351  * sparseFactor):
5352  * """ Python wrapper for superlu Sparse Factor Prepare function.
5353  */
5354 
5355 /* Python wrapper */
5356 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5357 static char __pyx_doc_15superluWrappers_sparseFactorPrepare[] = " Python wrapper for superlu Sparse Factor Prepare function.\n\n Arguments\n ---------\n sparse_matrix : superluWrappers.SparseMatrix\n sparseFactor: superluWrappers.SparseFactor\n\n ";
5358 static PyMethodDef __pyx_mdef_15superluWrappers_1sparseFactorPrepare = {"sparseFactorPrepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_1sparseFactorPrepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_sparseFactorPrepare};
5359 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5360  PyObject *__pyx_v_sparse_matrix = 0;
5361  PyObject *__pyx_v_sparseFactor = 0;
5362  int __pyx_lineno = 0;
5363  const char *__pyx_filename = NULL;
5364  int __pyx_clineno = 0;
5365  PyObject *__pyx_r = 0;
5366  __Pyx_RefNannyDeclarations
5367  __Pyx_RefNannySetupContext("sparseFactorPrepare (wrapper)", 0);
5368  {
5369  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparse_matrix,&__pyx_n_s_sparseFactor,0};
5370  PyObject* values[2] = {0,0};
5371  if (unlikely(__pyx_kwds)) {
5372  Py_ssize_t kw_args;
5373  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5374  switch (pos_args) {
5375  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5376  CYTHON_FALLTHROUGH;
5377  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5378  CYTHON_FALLTHROUGH;
5379  case 0: break;
5380  default: goto __pyx_L5_argtuple_error;
5381  }
5382  kw_args = PyDict_Size(__pyx_kwds);
5383  switch (pos_args) {
5384  case 0:
5385  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparse_matrix)) != 0)) kw_args--;
5386  else goto __pyx_L5_argtuple_error;
5387  CYTHON_FALLTHROUGH;
5388  case 1:
5389  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5390  else {
5391  __Pyx_RaiseArgtupleInvalid("sparseFactorPrepare", 1, 2, 2, 1); __PYX_ERR(0, 219, __pyx_L3_error)
5392  }
5393  }
5394  if (unlikely(kw_args > 0)) {
5395  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparseFactorPrepare") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
5396  }
5397  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5398  goto __pyx_L5_argtuple_error;
5399  } else {
5400  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5401  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5402  }
5403  __pyx_v_sparse_matrix = values[0];
5404  __pyx_v_sparseFactor = values[1];
5405  }
5406  goto __pyx_L4_argument_unpacking_done;
5407  __pyx_L5_argtuple_error:;
5408  __Pyx_RaiseArgtupleInvalid("sparseFactorPrepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
5409  __pyx_L3_error:;
5410  __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5411  __Pyx_RefNannyFinishContext();
5412  return NULL;
5413  __pyx_L4_argument_unpacking_done:;
5414  __pyx_r = __pyx_pf_15superluWrappers_sparseFactorPrepare(__pyx_self, __pyx_v_sparse_matrix, __pyx_v_sparseFactor);
5415 
5416  /* function exit code */
5417  __Pyx_RefNannyFinishContext();
5418  return __pyx_r;
5419 }
5420 
5421 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor) {
5422  PyObject *__pyx_r = NULL;
5423  __Pyx_RefNannyDeclarations
5424  PyObject *__pyx_t_1 = NULL;
5425  int __pyx_lineno = 0;
5426  const char *__pyx_filename = NULL;
5427  int __pyx_clineno = 0;
5428  __Pyx_RefNannySetupContext("sparseFactorPrepare", 0);
5429 
5430  /* "superluWrappers.pyx":229
5431  *
5432  * """
5433  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
5434  * sparseFactor)
5435  *
5436  */
5437  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sparse_matrix, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5438  __Pyx_GOTREF(__pyx_t_1);
5439  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5440 
5441  /* "superluWrappers.pyx":230
5442  * """
5443  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix,
5444  * sparseFactor) # <<<<<<<<<<<<<<
5445  *
5446  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm,
5447  */
5448  if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 230, __pyx_L1_error)
5449 
5450  /* "superluWrappers.pyx":229
5451  *
5452  * """
5453  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
5454  * sparseFactor)
5455  *
5456  */
5457  __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor));
5458  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5459 
5460  /* "superluWrappers.pyx":219
5461  * self.X.Store = &self.storeX
5462  *
5463  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
5464  * sparseFactor):
5465  * """ Python wrapper for superlu Sparse Factor Prepare function.
5466  */
5467 
5468  /* function exit code */
5469  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5470  goto __pyx_L0;
5471  __pyx_L1_error:;
5472  __Pyx_XDECREF(__pyx_t_1);
5473  __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5474  __pyx_r = NULL;
5475  __pyx_L0:;
5476  __Pyx_XGIVEREF(__pyx_r);
5477  __Pyx_RefNannyFinishContext();
5478  return __pyx_r;
5479 }
5480 
5481 /* "superluWrappers.pyx":232
5482  * sparseFactor)
5483  *
5484  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
5485  * SparseFactor sparseFactor):
5486  *
5487  */
5488 
5489 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor) {
5490  int __pyx_v_permc_spec;
5491  int __pyx_v_n;
5492  int __pyx_v_relax;
5493  int __pyx_v_panel_size;
5494  int __pyx_v_lwork;
5495  int __pyx_v_info;
5496  void *__pyx_v_work;
5497  PyObject *__pyx_v_i = NULL;
5498  __Pyx_RefNannyDeclarations
5499  __pyx_t_5numpy_int32_t __pyx_t_1;
5500  int __pyx_t_2;
5501  int __pyx_t_3;
5502  PyObject *__pyx_t_4 = NULL;
5503  PyObject *__pyx_t_5 = NULL;
5504  Py_ssize_t __pyx_t_6;
5505  PyObject *(*__pyx_t_7)(PyObject *);
5506  Py_ssize_t __pyx_t_8;
5507  Py_ssize_t __pyx_t_9;
5508  int __pyx_lineno = 0;
5509  const char *__pyx_filename = NULL;
5510  int __pyx_clineno = 0;
5511  __Pyx_RefNannySetupContext("superluWrappersSparseFactorPrepare", 0);
5512 
5513  /* "superluWrappers.pyx":235
5514  * SparseFactor sparseFactor):
5515  *
5516  * cdef int permc_spec = 3 # <<<<<<<<<<<<<<
5517  * cdef int n
5518  * cdef int relax=1
5519  */
5520  __pyx_v_permc_spec = 3;
5521 
5522  /* "superluWrappers.pyx":237
5523  * cdef int permc_spec = 3
5524  * cdef int n
5525  * cdef int relax=1 # <<<<<<<<<<<<<<
5526  * cdef int panel_size = 10
5527  * cdef int lwork = 0
5528  */
5529  __pyx_v_relax = 1;
5530 
5531  /* "superluWrappers.pyx":238
5532  * cdef int n
5533  * cdef int relax=1
5534  * cdef int panel_size = 10 # <<<<<<<<<<<<<<
5535  * cdef int lwork = 0
5536  * cdef int info = 0
5537  */
5538  __pyx_v_panel_size = 10;
5539 
5540  /* "superluWrappers.pyx":239
5541  * cdef int relax=1
5542  * cdef int panel_size = 10
5543  * cdef int lwork = 0 # <<<<<<<<<<<<<<
5544  * cdef int info = 0
5545  * cdef void *work = NULL
5546  */
5547  __pyx_v_lwork = 0;
5548 
5549  /* "superluWrappers.pyx":240
5550  * cdef int panel_size = 10
5551  * cdef int lwork = 0
5552  * cdef int info = 0 # <<<<<<<<<<<<<<
5553  * cdef void *work = NULL
5554  *
5555  */
5556  __pyx_v_info = 0;
5557 
5558  /* "superluWrappers.pyx":241
5559  * cdef int lwork = 0
5560  * cdef int info = 0
5561  * cdef void *work = NULL # <<<<<<<<<<<<<<
5562  *
5563  * sparseFactor.storeA.nnz = sm.A.nnz
5564  */
5565  __pyx_v_work = NULL;
5566 
5567  /* "superluWrappers.pyx":243
5568  * cdef void *work = NULL
5569  *
5570  * sparseFactor.storeA.nnz = sm.A.nnz # <<<<<<<<<<<<<<
5571  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5572  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5573  */
5574  __pyx_t_1 = __pyx_v_sm->A.nnz;
5575  __pyx_v_sparseFactor->storeA.nnz = __pyx_t_1;
5576 
5577  /* "superluWrappers.pyx":244
5578  *
5579  * sparseFactor.storeA.nnz = sm.A.nnz
5580  * sparseFactor.storeA.nzval = &sm.A.nzval[0] # <<<<<<<<<<<<<<
5581  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5582  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5583  */
5584  __pyx_v_sparseFactor->storeA.nzval = (&(__pyx_v_sm->A.nzval[0]));
5585 
5586  /* "superluWrappers.pyx":245
5587  * sparseFactor.storeA.nnz = sm.A.nnz
5588  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5589  * sparseFactor.storeA.colptr = &sm.A.rowptr[0] # <<<<<<<<<<<<<<
5590  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5591  *
5592  */
5593  __pyx_v_sparseFactor->storeA.colptr = (&(__pyx_v_sm->A.rowptr[0]));
5594 
5595  /* "superluWrappers.pyx":246
5596  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5597  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5598  * sparseFactor.storeA.rowind = &sm.A.colind[0] # <<<<<<<<<<<<<<
5599  *
5600  * if sparseFactor.use_same_perm_c == 0:
5601  */
5602  __pyx_v_sparseFactor->storeA.rowind = (&(__pyx_v_sm->A.colind[0]));
5603 
5604  /* "superluWrappers.pyx":248
5605  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5606  *
5607  * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
5608  * cget_perm_c(permc_spec,
5609  * &sparseFactor.A,
5610  */
5611  __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_perm_c == 0) != 0);
5612  if (__pyx_t_2) {
5613 
5614  /* "superluWrappers.pyx":249
5615  *
5616  * if sparseFactor.use_same_perm_c == 0:
5617  * cget_perm_c(permc_spec, # <<<<<<<<<<<<<<
5618  * &sparseFactor.A,
5619  * sparseFactor.perm_c)
5620  */
5621  get_perm_c(__pyx_v_permc_spec, (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c);
5622 
5623  /* "superluWrappers.pyx":252
5624  * &sparseFactor.A,
5625  * sparseFactor.perm_c)
5626  * sparseFactor.use_same_perm_c = 1 # <<<<<<<<<<<<<<
5627  *
5628  * if sparseFactor.use_same_sparsity == 0:
5629  */
5630  __pyx_v_sparseFactor->use_same_perm_c = 1;
5631 
5632  /* "superluWrappers.pyx":248
5633  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5634  *
5635  * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
5636  * cget_perm_c(permc_spec,
5637  * &sparseFactor.A,
5638  */
5639  }
5640 
5641  /* "superluWrappers.pyx":254
5642  * sparseFactor.use_same_perm_c = 1
5643  *
5644  * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
5645  * if sparseFactor.AC.Store != NULL:
5646  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5647  */
5648  __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_sparsity == 0) != 0);
5649  if (__pyx_t_2) {
5650 
5651  /* "superluWrappers.pyx":255
5652  *
5653  * if sparseFactor.use_same_sparsity == 0:
5654  * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
5655  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5656  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5657  */
5658  __pyx_t_2 = ((__pyx_v_sparseFactor->AC.Store != NULL) != 0);
5659  if (__pyx_t_2) {
5660 
5661  /* "superluWrappers.pyx":256
5662  * if sparseFactor.use_same_sparsity == 0:
5663  * if sparseFactor.AC.Store != NULL:
5664  * cDestroy_CompCol_Permuted(&sparseFactor.AC) # <<<<<<<<<<<<<<
5665  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5666  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5667  */
5668  Destroy_CompCol_Permuted((&__pyx_v_sparseFactor->AC));
5669 
5670  /* "superluWrappers.pyx":257
5671  * if sparseFactor.AC.Store != NULL:
5672  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5673  * cDestroy_SuperNode_Matrix(&sparseFactor.L) # <<<<<<<<<<<<<<
5674  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5675  * csp_preorder(&sparseFactor.options,
5676  */
5677  Destroy_SuperNode_Matrix((&__pyx_v_sparseFactor->L));
5678 
5679  /* "superluWrappers.pyx":258
5680  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5681  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5682  * cDestroy_CompCol_Matrix(&sparseFactor.U) # <<<<<<<<<<<<<<
5683  * csp_preorder(&sparseFactor.options,
5684  * &sparseFactor.A,
5685  */
5686  Destroy_CompCol_Matrix((&__pyx_v_sparseFactor->U));
5687 
5688  /* "superluWrappers.pyx":255
5689  *
5690  * if sparseFactor.use_same_sparsity == 0:
5691  * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
5692  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5693  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5694  */
5695  }
5696 
5697  /* "superluWrappers.pyx":259
5698  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5699  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5700  * csp_preorder(&sparseFactor.options, # <<<<<<<<<<<<<<
5701  * &sparseFactor.A,
5702  * sparseFactor.perm_c,
5703  */
5704  sp_preorder((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->etree, (&__pyx_v_sparseFactor->AC));
5705 
5706  /* "superluWrappers.pyx":264
5707  * sparseFactor.etree,
5708  * &sparseFactor.AC)
5709  * sparseFactor.use_same_sparsity = 1 # <<<<<<<<<<<<<<
5710  * else:
5711  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5712  */
5713  __pyx_v_sparseFactor->use_same_sparsity = 1;
5714 
5715  /* "superluWrappers.pyx":254
5716  * sparseFactor.use_same_perm_c = 1
5717  *
5718  * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
5719  * if sparseFactor.AC.Store != NULL:
5720  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5721  */
5722  goto __pyx_L4;
5723  }
5724 
5725  /* "superluWrappers.pyx":266
5726  * sparseFactor.use_same_sparsity = 1
5727  * else:
5728  * sparseFactor.options.Fact = _SamePattern_SameRowPerm # <<<<<<<<<<<<<<
5729  * n = sparseFactor.A.ncol
5730  * for i in range(n):
5731  */
5732  /*else*/ {
5733  __pyx_v_sparseFactor->options.Fact = SamePattern_SameRowPerm;
5734 
5735  /* "superluWrappers.pyx":267
5736  * else:
5737  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5738  * n = sparseFactor.A.ncol # <<<<<<<<<<<<<<
5739  * for i in range(n):
5740  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5741  */
5742  __pyx_t_3 = __pyx_v_sparseFactor->A.ncol;
5743  __pyx_v_n = __pyx_t_3;
5744 
5745  /* "superluWrappers.pyx":268
5746  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5747  * n = sparseFactor.A.ncol
5748  * for i in range(n): # <<<<<<<<<<<<<<
5749  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5750  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5751  */
5752  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5753  __Pyx_GOTREF(__pyx_t_4);
5754  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5755  __Pyx_GOTREF(__pyx_t_5);
5756  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5757  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
5758  __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
5759  __pyx_t_7 = NULL;
5760  } else {
5761  __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5762  __Pyx_GOTREF(__pyx_t_4);
5763  __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
5764  }
5765  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5766  for (;;) {
5767  if (likely(!__pyx_t_7)) {
5768  if (likely(PyList_CheckExact(__pyx_t_4))) {
5769  if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
5770  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5771  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5772  #else
5773  __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5774  __Pyx_GOTREF(__pyx_t_5);
5775  #endif
5776  } else {
5777  if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
5778  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5779  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5780  #else
5781  __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5782  __Pyx_GOTREF(__pyx_t_5);
5783  #endif
5784  }
5785  } else {
5786  __pyx_t_5 = __pyx_t_7(__pyx_t_4);
5787  if (unlikely(!__pyx_t_5)) {
5788  PyObject* exc_type = PyErr_Occurred();
5789  if (exc_type) {
5790  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5791  else __PYX_ERR(0, 268, __pyx_L1_error)
5792  }
5793  break;
5794  }
5795  __Pyx_GOTREF(__pyx_t_5);
5796  }
5797  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
5798  __pyx_t_5 = 0;
5799 
5800  /* "superluWrappers.pyx":269
5801  * n = sparseFactor.A.ncol
5802  * for i in range(n):
5803  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i] # <<<<<<<<<<<<<<
5804  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5805  * cdgstrf(&sparseFactor.options,
5806  */
5807  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5808  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5809  (((struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colbeg[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5810 
5811  /* "superluWrappers.pyx":270
5812  * for i in range(n):
5813  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5814  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1] # <<<<<<<<<<<<<<
5815  * cdgstrf(&sparseFactor.options,
5816  * &sparseFactor.AC,
5817  */
5818  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error)
5819  __Pyx_GOTREF(__pyx_t_5);
5820  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5821  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5822  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5823  (((struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colend[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5824 
5825  /* "superluWrappers.pyx":268
5826  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5827  * n = sparseFactor.A.ncol
5828  * for i in range(n): # <<<<<<<<<<<<<<
5829  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5830  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5831  */
5832  }
5833  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5834  }
5835  __pyx_L4:;
5836 
5837  /* "superluWrappers.pyx":271
5838  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5839  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5840  * cdgstrf(&sparseFactor.options, # <<<<<<<<<<<<<<
5841  * &sparseFactor.AC,
5842  * relax,
5843  */
5844  dgstrf((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->AC), __pyx_v_relax, __pyx_v_panel_size, __pyx_v_sparseFactor->etree, __pyx_v_work, __pyx_v_lwork, __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), (&__pyx_v_sparseFactor->Glu), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
5845 
5846  /* "superluWrappers.pyx":232
5847  * sparseFactor)
5848  *
5849  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
5850  * SparseFactor sparseFactor):
5851  *
5852  */
5853 
5854  /* function exit code */
5855  goto __pyx_L0;
5856  __pyx_L1_error:;
5857  __Pyx_XDECREF(__pyx_t_4);
5858  __Pyx_XDECREF(__pyx_t_5);
5859  __Pyx_WriteUnraisable("superluWrappers.superluWrappersSparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5860  __pyx_L0:;
5861  __Pyx_XDECREF(__pyx_v_i);
5862  __Pyx_RefNannyFinishContext();
5863 }
5864 
5865 /* "superluWrappers.pyx":286
5866  * &info)
5867  *
5868  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5869  * x):
5870  * """ Sparse factor solve wrappers
5871  */
5872 
5873 /* Python wrapper */
5874 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5875 static char __pyx_doc_15superluWrappers_2sparseFactorSolve[] = " Sparse factor solve wrappers\n\n Arguments\n ---------\n sparseFactor : superluWrappers.SparseFactor\n x (input / output) : np.array\n x serves as the right hand side and then becomes the solution\n ";
5876 static PyMethodDef __pyx_mdef_15superluWrappers_3sparseFactorSolve = {"sparseFactorSolve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_3sparseFactorSolve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_2sparseFactorSolve};
5877 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5878  PyObject *__pyx_v_sparseFactor = 0;
5879  PyObject *__pyx_v_x = 0;
5880  int __pyx_lineno = 0;
5881  const char *__pyx_filename = NULL;
5882  int __pyx_clineno = 0;
5883  PyObject *__pyx_r = 0;
5884  __Pyx_RefNannyDeclarations
5885  __Pyx_RefNannySetupContext("sparseFactorSolve (wrapper)", 0);
5886  {
5887  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparseFactor,&__pyx_n_s_x,0};
5888  PyObject* values[2] = {0,0};
5889  if (unlikely(__pyx_kwds)) {
5890  Py_ssize_t kw_args;
5891  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5892  switch (pos_args) {
5893  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5894  CYTHON_FALLTHROUGH;
5895  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5896  CYTHON_FALLTHROUGH;
5897  case 0: break;
5898  default: goto __pyx_L5_argtuple_error;
5899  }
5900  kw_args = PyDict_Size(__pyx_kwds);
5901  switch (pos_args) {
5902  case 0:
5903  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5904  else goto __pyx_L5_argtuple_error;
5905  CYTHON_FALLTHROUGH;
5906  case 1:
5907  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5908  else {
5909  __Pyx_RaiseArgtupleInvalid("sparseFactorSolve", 1, 2, 2, 1); __PYX_ERR(0, 286, __pyx_L3_error)
5910  }
5911  }
5912  if (unlikely(kw_args > 0)) {
5913  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparseFactorSolve") < 0)) __PYX_ERR(0, 286, __pyx_L3_error)
5914  }
5915  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5916  goto __pyx_L5_argtuple_error;
5917  } else {
5918  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5919  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5920  }
5921  __pyx_v_sparseFactor = values[0];
5922  __pyx_v_x = values[1];
5923  }
5924  goto __pyx_L4_argument_unpacking_done;
5925  __pyx_L5_argtuple_error:;
5926  __Pyx_RaiseArgtupleInvalid("sparseFactorSolve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 286, __pyx_L3_error)
5927  __pyx_L3_error:;
5928  __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5929  __Pyx_RefNannyFinishContext();
5930  return NULL;
5931  __pyx_L4_argument_unpacking_done:;
5932  __pyx_r = __pyx_pf_15superluWrappers_2sparseFactorSolve(__pyx_self, __pyx_v_sparseFactor, __pyx_v_x);
5933 
5934  /* function exit code */
5935  __Pyx_RefNannyFinishContext();
5936  return __pyx_r;
5937 }
5938 
5939 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x) {
5940  PyObject *__pyx_r = NULL;
5941  __Pyx_RefNannyDeclarations
5942  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
5943  int __pyx_lineno = 0;
5944  const char *__pyx_filename = NULL;
5945  int __pyx_clineno = 0;
5946  __Pyx_RefNannySetupContext("sparseFactorSolve", 0);
5947 
5948  /* "superluWrappers.pyx":296
5949  * x serves as the right hand side and then becomes the solution
5950  * """
5951  * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5952  * x)
5953  *
5954  */
5955  if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 296, __pyx_L1_error)
5956 
5957  /* "superluWrappers.pyx":297
5958  * """
5959  * superluWrappersSparseFactorSolve(sparseFactor,
5960  * x) # <<<<<<<<<<<<<<
5961  *
5962  *
5963  */
5964  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
5965 
5966  /* "superluWrappers.pyx":296
5967  * x serves as the right hand side and then becomes the solution
5968  * """
5969  * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5970  * x)
5971  *
5972  */
5973  __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor), __pyx_t_1);
5974  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5975  __pyx_t_1.memview = NULL;
5976  __pyx_t_1.data = NULL;
5977 
5978  /* "superluWrappers.pyx":286
5979  * &info)
5980  *
5981  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5982  * x):
5983  * """ Sparse factor solve wrappers
5984  */
5985 
5986  /* function exit code */
5987  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5988  goto __pyx_L0;
5989  __pyx_L1_error:;
5990  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5991  __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5992  __pyx_r = NULL;
5993  __pyx_L0:;
5994  __Pyx_XGIVEREF(__pyx_r);
5995  __Pyx_RefNannyFinishContext();
5996  return __pyx_r;
5997 }
5998 
5999 /* "superluWrappers.pyx":300
6000  *
6001  *
6002  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
6003  * np.float64_t [:] x):
6004  * cdef _trans_t trans = _TRANS
6005  */
6006 
6007 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor, __Pyx_memviewslice __pyx_v_x) {
6008  trans_t __pyx_v_trans;
6009  int __pyx_v_info;
6010  __Pyx_RefNannyDeclarations
6011  Py_ssize_t __pyx_t_1;
6012  __Pyx_RefNannySetupContext("superluWrappersSparseFactorSolve", 0);
6013 
6014  /* "superluWrappers.pyx":302
6015  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor,
6016  * np.float64_t [:] x):
6017  * cdef _trans_t trans = _TRANS # <<<<<<<<<<<<<<
6018  * cdef int info = 0
6019  *
6020  */
6021  __pyx_v_trans = TRANS;
6022 
6023  /* "superluWrappers.pyx":303
6024  * np.float64_t [:] x):
6025  * cdef _trans_t trans = _TRANS
6026  * cdef int info = 0 # <<<<<<<<<<<<<<
6027  *
6028  * sparseFactor.storeX.nzval = &x[0]
6029  */
6030  __pyx_v_info = 0;
6031 
6032  /* "superluWrappers.pyx":305
6033  * cdef int info = 0
6034  *
6035  * sparseFactor.storeX.nzval = &x[0] # <<<<<<<<<<<<<<
6036  *
6037  * cdgstrs(trans,
6038  */
6039  __pyx_t_1 = 0;
6040  __pyx_v_sparseFactor->storeX.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_1 * __pyx_v_x.strides[0]) ))));
6041 
6042  /* "superluWrappers.pyx":307
6043  * sparseFactor.storeX.nzval = &x[0]
6044  *
6045  * cdgstrs(trans, # <<<<<<<<<<<<<<
6046  * &sparseFactor.L,
6047  * &sparseFactor.U,
6048  */
6049  dgstrs(__pyx_v_trans, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->X), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
6050 
6051  /* "superluWrappers.pyx":300
6052  *
6053  *
6054  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
6055  * np.float64_t [:] x):
6056  * cdef _trans_t trans = _TRANS
6057  */
6058 
6059  /* function exit code */
6060  __Pyx_RefNannyFinishContext();
6061 }
6062 
6063 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735
6064  * ctypedef npy_cdouble complex_t
6065  *
6066  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6067  * return PyArray_MultiIterNew(1, <void*>a)
6068  *
6069  */
6070 
6071 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6072  PyObject *__pyx_r = NULL;
6073  __Pyx_RefNannyDeclarations
6074  PyObject *__pyx_t_1 = NULL;
6075  int __pyx_lineno = 0;
6076  const char *__pyx_filename = NULL;
6077  int __pyx_clineno = 0;
6078  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
6079 
6080  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":736
6081  *
6082  * cdef inline object PyArray_MultiIterNew1(a):
6083  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6084  *
6085  * cdef inline object PyArray_MultiIterNew2(a, b):
6086  */
6087  __Pyx_XDECREF(__pyx_r);
6088  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
6089  __Pyx_GOTREF(__pyx_t_1);
6090  __pyx_r = __pyx_t_1;
6091  __pyx_t_1 = 0;
6092  goto __pyx_L0;
6093 
6094  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735
6095  * ctypedef npy_cdouble complex_t
6096  *
6097  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6098  * return PyArray_MultiIterNew(1, <void*>a)
6099  *
6100  */
6101 
6102  /* function exit code */
6103  __pyx_L1_error:;
6104  __Pyx_XDECREF(__pyx_t_1);
6105  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6106  __pyx_r = 0;
6107  __pyx_L0:;
6108  __Pyx_XGIVEREF(__pyx_r);
6109  __Pyx_RefNannyFinishContext();
6110  return __pyx_r;
6111 }
6112 
6113 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738
6114  * return PyArray_MultiIterNew(1, <void*>a)
6115  *
6116  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6117  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6118  *
6119  */
6120 
6121 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6122  PyObject *__pyx_r = NULL;
6123  __Pyx_RefNannyDeclarations
6124  PyObject *__pyx_t_1 = NULL;
6125  int __pyx_lineno = 0;
6126  const char *__pyx_filename = NULL;
6127  int __pyx_clineno = 0;
6128  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
6129 
6130  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":739
6131  *
6132  * cdef inline object PyArray_MultiIterNew2(a, b):
6133  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6134  *
6135  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6136  */
6137  __Pyx_XDECREF(__pyx_r);
6138  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
6139  __Pyx_GOTREF(__pyx_t_1);
6140  __pyx_r = __pyx_t_1;
6141  __pyx_t_1 = 0;
6142  goto __pyx_L0;
6143 
6144  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738
6145  * return PyArray_MultiIterNew(1, <void*>a)
6146  *
6147  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6148  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6149  *
6150  */
6151 
6152  /* function exit code */
6153  __pyx_L1_error:;
6154  __Pyx_XDECREF(__pyx_t_1);
6155  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6156  __pyx_r = 0;
6157  __pyx_L0:;
6158  __Pyx_XGIVEREF(__pyx_r);
6159  __Pyx_RefNannyFinishContext();
6160  return __pyx_r;
6161 }
6162 
6163 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741
6164  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6165  *
6166  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6167  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6168  *
6169  */
6170 
6171 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6172  PyObject *__pyx_r = NULL;
6173  __Pyx_RefNannyDeclarations
6174  PyObject *__pyx_t_1 = NULL;
6175  int __pyx_lineno = 0;
6176  const char *__pyx_filename = NULL;
6177  int __pyx_clineno = 0;
6178  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
6179 
6180  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":742
6181  *
6182  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6183  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6184  *
6185  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6186  */
6187  __Pyx_XDECREF(__pyx_r);
6188  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
6189  __Pyx_GOTREF(__pyx_t_1);
6190  __pyx_r = __pyx_t_1;
6191  __pyx_t_1 = 0;
6192  goto __pyx_L0;
6193 
6194  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741
6195  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6196  *
6197  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6198  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6199  *
6200  */
6201 
6202  /* function exit code */
6203  __pyx_L1_error:;
6204  __Pyx_XDECREF(__pyx_t_1);
6205  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6206  __pyx_r = 0;
6207  __pyx_L0:;
6208  __Pyx_XGIVEREF(__pyx_r);
6209  __Pyx_RefNannyFinishContext();
6210  return __pyx_r;
6211 }
6212 
6213 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744
6214  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6215  *
6216  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6217  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6218  *
6219  */
6220 
6221 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6222  PyObject *__pyx_r = NULL;
6223  __Pyx_RefNannyDeclarations
6224  PyObject *__pyx_t_1 = NULL;
6225  int __pyx_lineno = 0;
6226  const char *__pyx_filename = NULL;
6227  int __pyx_clineno = 0;
6228  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
6229 
6230  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":745
6231  *
6232  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6233  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
6234  *
6235  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6236  */
6237  __Pyx_XDECREF(__pyx_r);
6238  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
6239  __Pyx_GOTREF(__pyx_t_1);
6240  __pyx_r = __pyx_t_1;
6241  __pyx_t_1 = 0;
6242  goto __pyx_L0;
6243 
6244  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744
6245  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6246  *
6247  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6248  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6249  *
6250  */
6251 
6252  /* function exit code */
6253  __pyx_L1_error:;
6254  __Pyx_XDECREF(__pyx_t_1);
6255  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6256  __pyx_r = 0;
6257  __pyx_L0:;
6258  __Pyx_XGIVEREF(__pyx_r);
6259  __Pyx_RefNannyFinishContext();
6260  return __pyx_r;
6261 }
6262 
6263 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747
6264  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6265  *
6266  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6267  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6268  *
6269  */
6270 
6271 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6272  PyObject *__pyx_r = NULL;
6273  __Pyx_RefNannyDeclarations
6274  PyObject *__pyx_t_1 = NULL;
6275  int __pyx_lineno = 0;
6276  const char *__pyx_filename = NULL;
6277  int __pyx_clineno = 0;
6278  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
6279 
6280  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":748
6281  *
6282  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6283  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
6284  *
6285  * cdef inline tuple PyDataType_SHAPE(dtype d):
6286  */
6287  __Pyx_XDECREF(__pyx_r);
6288  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
6289  __Pyx_GOTREF(__pyx_t_1);
6290  __pyx_r = __pyx_t_1;
6291  __pyx_t_1 = 0;
6292  goto __pyx_L0;
6293 
6294  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747
6295  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6296  *
6297  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6298  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6299  *
6300  */
6301 
6302  /* function exit code */
6303  __pyx_L1_error:;
6304  __Pyx_XDECREF(__pyx_t_1);
6305  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6306  __pyx_r = 0;
6307  __pyx_L0:;
6308  __Pyx_XGIVEREF(__pyx_r);
6309  __Pyx_RefNannyFinishContext();
6310  return __pyx_r;
6311 }
6312 
6313 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750
6314  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6315  *
6316  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6317  * if PyDataType_HASSUBARRAY(d):
6318  * return <tuple>d.subarray.shape
6319  */
6320 
6321 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6322  PyObject *__pyx_r = NULL;
6323  __Pyx_RefNannyDeclarations
6324  int __pyx_t_1;
6325  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
6326 
6327  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751
6328  *
6329  * cdef inline tuple PyDataType_SHAPE(dtype d):
6330  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6331  * return <tuple>d.subarray.shape
6332  * else:
6333  */
6334  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6335  if (__pyx_t_1) {
6336 
6337  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":752
6338  * cdef inline tuple PyDataType_SHAPE(dtype d):
6339  * if PyDataType_HASSUBARRAY(d):
6340  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
6341  * else:
6342  * return ()
6343  */
6344  __Pyx_XDECREF(__pyx_r);
6345  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6346  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6347  goto __pyx_L0;
6348 
6349  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751
6350  *
6351  * cdef inline tuple PyDataType_SHAPE(dtype d):
6352  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6353  * return <tuple>d.subarray.shape
6354  * else:
6355  */
6356  }
6357 
6358  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":754
6359  * return <tuple>d.subarray.shape
6360  * else:
6361  * return () # <<<<<<<<<<<<<<
6362  *
6363  *
6364  */
6365  /*else*/ {
6366  __Pyx_XDECREF(__pyx_r);
6367  __Pyx_INCREF(__pyx_empty_tuple);
6368  __pyx_r = __pyx_empty_tuple;
6369  goto __pyx_L0;
6370  }
6371 
6372  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750
6373  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6374  *
6375  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6376  * if PyDataType_HASSUBARRAY(d):
6377  * return <tuple>d.subarray.shape
6378  */
6379 
6380  /* function exit code */
6381  __pyx_L0:;
6382  __Pyx_XGIVEREF(__pyx_r);
6383  __Pyx_RefNannyFinishContext();
6384  return __pyx_r;
6385 }
6386 
6387 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929
6388  * int _import_umath() except -1
6389  *
6390  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
6391  * Py_INCREF(base) # important to do this before stealing the reference below!
6392  * PyArray_SetBaseObject(arr, base)
6393  */
6394 
6395 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
6396  __Pyx_RefNannyDeclarations
6397  __Pyx_RefNannySetupContext("set_array_base", 0);
6398 
6399  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":930
6400  *
6401  * cdef inline void set_array_base(ndarray arr, object base):
6402  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
6403  * PyArray_SetBaseObject(arr, base)
6404  *
6405  */
6406  Py_INCREF(__pyx_v_base);
6407 
6408  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":931
6409  * cdef inline void set_array_base(ndarray arr, object base):
6410  * Py_INCREF(base) # important to do this before stealing the reference below!
6411  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
6412  *
6413  * cdef inline object get_array_base(ndarray arr):
6414  */
6415  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
6416 
6417  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929
6418  * int _import_umath() except -1
6419  *
6420  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
6421  * Py_INCREF(base) # important to do this before stealing the reference below!
6422  * PyArray_SetBaseObject(arr, base)
6423  */
6424 
6425  /* function exit code */
6426  __Pyx_RefNannyFinishContext();
6427 }
6428 
6429 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933
6430  * PyArray_SetBaseObject(arr, base)
6431  *
6432  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
6433  * base = PyArray_BASE(arr)
6434  * if base is NULL:
6435  */
6436 
6437 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
6438  PyObject *__pyx_v_base;
6439  PyObject *__pyx_r = NULL;
6440  __Pyx_RefNannyDeclarations
6441  int __pyx_t_1;
6442  __Pyx_RefNannySetupContext("get_array_base", 0);
6443 
6444  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":934
6445  *
6446  * cdef inline object get_array_base(ndarray arr):
6447  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
6448  * if base is NULL:
6449  * return None
6450  */
6451  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
6452 
6453  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935
6454  * cdef inline object get_array_base(ndarray arr):
6455  * base = PyArray_BASE(arr)
6456  * if base is NULL: # <<<<<<<<<<<<<<
6457  * return None
6458  * return <object>base
6459  */
6460  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
6461  if (__pyx_t_1) {
6462 
6463  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":936
6464  * base = PyArray_BASE(arr)
6465  * if base is NULL:
6466  * return None # <<<<<<<<<<<<<<
6467  * return <object>base
6468  *
6469  */
6470  __Pyx_XDECREF(__pyx_r);
6471  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6472  goto __pyx_L0;
6473 
6474  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935
6475  * cdef inline object get_array_base(ndarray arr):
6476  * base = PyArray_BASE(arr)
6477  * if base is NULL: # <<<<<<<<<<<<<<
6478  * return None
6479  * return <object>base
6480  */
6481  }
6482 
6483  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":937
6484  * if base is NULL:
6485  * return None
6486  * return <object>base # <<<<<<<<<<<<<<
6487  *
6488  * # Versions of the import_* functions which are more suitable for
6489  */
6490  __Pyx_XDECREF(__pyx_r);
6491  __Pyx_INCREF(((PyObject *)__pyx_v_base));
6492  __pyx_r = ((PyObject *)__pyx_v_base);
6493  goto __pyx_L0;
6494 
6495  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933
6496  * PyArray_SetBaseObject(arr, base)
6497  *
6498  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
6499  * base = PyArray_BASE(arr)
6500  * if base is NULL:
6501  */
6502 
6503  /* function exit code */
6504  __pyx_L0:;
6505  __Pyx_XGIVEREF(__pyx_r);
6506  __Pyx_RefNannyFinishContext();
6507  return __pyx_r;
6508 }
6509 
6510 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941
6511  * # Versions of the import_* functions which are more suitable for
6512  * # Cython code.
6513  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
6514  * try:
6515  * __pyx_import_array()
6516  */
6517 
6518 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
6519  int __pyx_r;
6520  __Pyx_RefNannyDeclarations
6521  PyObject *__pyx_t_1 = NULL;
6522  PyObject *__pyx_t_2 = NULL;
6523  PyObject *__pyx_t_3 = NULL;
6524  int __pyx_t_4;
6525  PyObject *__pyx_t_5 = NULL;
6526  PyObject *__pyx_t_6 = NULL;
6527  PyObject *__pyx_t_7 = NULL;
6528  PyObject *__pyx_t_8 = NULL;
6529  int __pyx_lineno = 0;
6530  const char *__pyx_filename = NULL;
6531  int __pyx_clineno = 0;
6532  __Pyx_RefNannySetupContext("import_array", 0);
6533 
6534  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
6535  * # Cython code.
6536  * cdef inline int import_array() except -1:
6537  * try: # <<<<<<<<<<<<<<
6538  * __pyx_import_array()
6539  * except Exception:
6540  */
6541  {
6542  __Pyx_PyThreadState_declare
6543  __Pyx_PyThreadState_assign
6544  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6545  __Pyx_XGOTREF(__pyx_t_1);
6546  __Pyx_XGOTREF(__pyx_t_2);
6547  __Pyx_XGOTREF(__pyx_t_3);
6548  /*try:*/ {
6549 
6550  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":943
6551  * cdef inline int import_array() except -1:
6552  * try:
6553  * __pyx_import_array() # <<<<<<<<<<<<<<
6554  * except Exception:
6555  * raise ImportError("numpy.core.multiarray failed to import")
6556  */
6557  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
6558 
6559  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
6560  * # Cython code.
6561  * cdef inline int import_array() except -1:
6562  * try: # <<<<<<<<<<<<<<
6563  * __pyx_import_array()
6564  * except Exception:
6565  */
6566  }
6567  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6568  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6569  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6570  goto __pyx_L8_try_end;
6571  __pyx_L3_error:;
6572 
6573  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":944
6574  * try:
6575  * __pyx_import_array()
6576  * except Exception: # <<<<<<<<<<<<<<
6577  * raise ImportError("numpy.core.multiarray failed to import")
6578  *
6579  */
6580  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6581  if (__pyx_t_4) {
6582  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6583  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
6584  __Pyx_GOTREF(__pyx_t_5);
6585  __Pyx_GOTREF(__pyx_t_6);
6586  __Pyx_GOTREF(__pyx_t_7);
6587 
6588  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945
6589  * __pyx_import_array()
6590  * except Exception:
6591  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
6592  *
6593  * cdef inline int import_umath() except -1:
6594  */
6595  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
6596  __Pyx_GOTREF(__pyx_t_8);
6597  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6598  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6599  __PYX_ERR(2, 945, __pyx_L5_except_error)
6600  }
6601  goto __pyx_L5_except_error;
6602  __pyx_L5_except_error:;
6603 
6604  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
6605  * # Cython code.
6606  * cdef inline int import_array() except -1:
6607  * try: # <<<<<<<<<<<<<<
6608  * __pyx_import_array()
6609  * except Exception:
6610  */
6611  __Pyx_XGIVEREF(__pyx_t_1);
6612  __Pyx_XGIVEREF(__pyx_t_2);
6613  __Pyx_XGIVEREF(__pyx_t_3);
6614  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6615  goto __pyx_L1_error;
6616  __pyx_L8_try_end:;
6617  }
6618 
6619  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941
6620  * # Versions of the import_* functions which are more suitable for
6621  * # Cython code.
6622  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
6623  * try:
6624  * __pyx_import_array()
6625  */
6626 
6627  /* function exit code */
6628  __pyx_r = 0;
6629  goto __pyx_L0;
6630  __pyx_L1_error:;
6631  __Pyx_XDECREF(__pyx_t_5);
6632  __Pyx_XDECREF(__pyx_t_6);
6633  __Pyx_XDECREF(__pyx_t_7);
6634  __Pyx_XDECREF(__pyx_t_8);
6635  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6636  __pyx_r = -1;
6637  __pyx_L0:;
6638  __Pyx_RefNannyFinishContext();
6639  return __pyx_r;
6640 }
6641 
6642 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947
6643  * raise ImportError("numpy.core.multiarray failed to import")
6644  *
6645  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6646  * try:
6647  * _import_umath()
6648  */
6649 
6650 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
6651  int __pyx_r;
6652  __Pyx_RefNannyDeclarations
6653  PyObject *__pyx_t_1 = NULL;
6654  PyObject *__pyx_t_2 = NULL;
6655  PyObject *__pyx_t_3 = NULL;
6656  int __pyx_t_4;
6657  PyObject *__pyx_t_5 = NULL;
6658  PyObject *__pyx_t_6 = NULL;
6659  PyObject *__pyx_t_7 = NULL;
6660  PyObject *__pyx_t_8 = NULL;
6661  int __pyx_lineno = 0;
6662  const char *__pyx_filename = NULL;
6663  int __pyx_clineno = 0;
6664  __Pyx_RefNannySetupContext("import_umath", 0);
6665 
6666  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
6667  *
6668  * cdef inline int import_umath() except -1:
6669  * try: # <<<<<<<<<<<<<<
6670  * _import_umath()
6671  * except Exception:
6672  */
6673  {
6674  __Pyx_PyThreadState_declare
6675  __Pyx_PyThreadState_assign
6676  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6677  __Pyx_XGOTREF(__pyx_t_1);
6678  __Pyx_XGOTREF(__pyx_t_2);
6679  __Pyx_XGOTREF(__pyx_t_3);
6680  /*try:*/ {
6681 
6682  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":949
6683  * cdef inline int import_umath() except -1:
6684  * try:
6685  * _import_umath() # <<<<<<<<<<<<<<
6686  * except Exception:
6687  * raise ImportError("numpy.core.umath failed to import")
6688  */
6689  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
6690 
6691  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
6692  *
6693  * cdef inline int import_umath() except -1:
6694  * try: # <<<<<<<<<<<<<<
6695  * _import_umath()
6696  * except Exception:
6697  */
6698  }
6699  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6700  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6701  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6702  goto __pyx_L8_try_end;
6703  __pyx_L3_error:;
6704 
6705  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":950
6706  * try:
6707  * _import_umath()
6708  * except Exception: # <<<<<<<<<<<<<<
6709  * raise ImportError("numpy.core.umath failed to import")
6710  *
6711  */
6712  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6713  if (__pyx_t_4) {
6714  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6715  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
6716  __Pyx_GOTREF(__pyx_t_5);
6717  __Pyx_GOTREF(__pyx_t_6);
6718  __Pyx_GOTREF(__pyx_t_7);
6719 
6720  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951
6721  * _import_umath()
6722  * except Exception:
6723  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6724  *
6725  * cdef inline int import_ufunc() except -1:
6726  */
6727  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
6728  __Pyx_GOTREF(__pyx_t_8);
6729  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6730  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6731  __PYX_ERR(2, 951, __pyx_L5_except_error)
6732  }
6733  goto __pyx_L5_except_error;
6734  __pyx_L5_except_error:;
6735 
6736  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
6737  *
6738  * cdef inline int import_umath() except -1:
6739  * try: # <<<<<<<<<<<<<<
6740  * _import_umath()
6741  * except Exception:
6742  */
6743  __Pyx_XGIVEREF(__pyx_t_1);
6744  __Pyx_XGIVEREF(__pyx_t_2);
6745  __Pyx_XGIVEREF(__pyx_t_3);
6746  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6747  goto __pyx_L1_error;
6748  __pyx_L8_try_end:;
6749  }
6750 
6751  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947
6752  * raise ImportError("numpy.core.multiarray failed to import")
6753  *
6754  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6755  * try:
6756  * _import_umath()
6757  */
6758 
6759  /* function exit code */
6760  __pyx_r = 0;
6761  goto __pyx_L0;
6762  __pyx_L1_error:;
6763  __Pyx_XDECREF(__pyx_t_5);
6764  __Pyx_XDECREF(__pyx_t_6);
6765  __Pyx_XDECREF(__pyx_t_7);
6766  __Pyx_XDECREF(__pyx_t_8);
6767  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6768  __pyx_r = -1;
6769  __pyx_L0:;
6770  __Pyx_RefNannyFinishContext();
6771  return __pyx_r;
6772 }
6773 
6774 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953
6775  * raise ImportError("numpy.core.umath failed to import")
6776  *
6777  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6778  * try:
6779  * _import_umath()
6780  */
6781 
6782 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
6783  int __pyx_r;
6784  __Pyx_RefNannyDeclarations
6785  PyObject *__pyx_t_1 = NULL;
6786  PyObject *__pyx_t_2 = NULL;
6787  PyObject *__pyx_t_3 = NULL;
6788  int __pyx_t_4;
6789  PyObject *__pyx_t_5 = NULL;
6790  PyObject *__pyx_t_6 = NULL;
6791  PyObject *__pyx_t_7 = NULL;
6792  PyObject *__pyx_t_8 = NULL;
6793  int __pyx_lineno = 0;
6794  const char *__pyx_filename = NULL;
6795  int __pyx_clineno = 0;
6796  __Pyx_RefNannySetupContext("import_ufunc", 0);
6797 
6798  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
6799  *
6800  * cdef inline int import_ufunc() except -1:
6801  * try: # <<<<<<<<<<<<<<
6802  * _import_umath()
6803  * except Exception:
6804  */
6805  {
6806  __Pyx_PyThreadState_declare
6807  __Pyx_PyThreadState_assign
6808  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6809  __Pyx_XGOTREF(__pyx_t_1);
6810  __Pyx_XGOTREF(__pyx_t_2);
6811  __Pyx_XGOTREF(__pyx_t_3);
6812  /*try:*/ {
6813 
6814  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":955
6815  * cdef inline int import_ufunc() except -1:
6816  * try:
6817  * _import_umath() # <<<<<<<<<<<<<<
6818  * except Exception:
6819  * raise ImportError("numpy.core.umath failed to import")
6820  */
6821  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
6822 
6823  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
6824  *
6825  * cdef inline int import_ufunc() except -1:
6826  * try: # <<<<<<<<<<<<<<
6827  * _import_umath()
6828  * except Exception:
6829  */
6830  }
6831  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6832  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6833  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6834  goto __pyx_L8_try_end;
6835  __pyx_L3_error:;
6836 
6837  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":956
6838  * try:
6839  * _import_umath()
6840  * except Exception: # <<<<<<<<<<<<<<
6841  * raise ImportError("numpy.core.umath failed to import")
6842  *
6843  */
6844  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6845  if (__pyx_t_4) {
6846  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6847  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
6848  __Pyx_GOTREF(__pyx_t_5);
6849  __Pyx_GOTREF(__pyx_t_6);
6850  __Pyx_GOTREF(__pyx_t_7);
6851 
6852  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":957
6853  * _import_umath()
6854  * except Exception:
6855  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6856  *
6857  * cdef extern from *:
6858  */
6859  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
6860  __Pyx_GOTREF(__pyx_t_8);
6861  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6862  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6863  __PYX_ERR(2, 957, __pyx_L5_except_error)
6864  }
6865  goto __pyx_L5_except_error;
6866  __pyx_L5_except_error:;
6867 
6868  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
6869  *
6870  * cdef inline int import_ufunc() except -1:
6871  * try: # <<<<<<<<<<<<<<
6872  * _import_umath()
6873  * except Exception:
6874  */
6875  __Pyx_XGIVEREF(__pyx_t_1);
6876  __Pyx_XGIVEREF(__pyx_t_2);
6877  __Pyx_XGIVEREF(__pyx_t_3);
6878  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6879  goto __pyx_L1_error;
6880  __pyx_L8_try_end:;
6881  }
6882 
6883  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953
6884  * raise ImportError("numpy.core.umath failed to import")
6885  *
6886  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6887  * try:
6888  * _import_umath()
6889  */
6890 
6891  /* function exit code */
6892  __pyx_r = 0;
6893  goto __pyx_L0;
6894  __pyx_L1_error:;
6895  __Pyx_XDECREF(__pyx_t_5);
6896  __Pyx_XDECREF(__pyx_t_6);
6897  __Pyx_XDECREF(__pyx_t_7);
6898  __Pyx_XDECREF(__pyx_t_8);
6899  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6900  __pyx_r = -1;
6901  __pyx_L0:;
6902  __Pyx_RefNannyFinishContext();
6903  return __pyx_r;
6904 }
6905 
6906 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967
6907  *
6908  *
6909  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
6910  * """
6911  * Cython equivalent of `isinstance(obj, np.timedelta64)`
6912  */
6913 
6914 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
6915  int __pyx_r;
6916  __Pyx_RefNannyDeclarations
6917  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
6918 
6919  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":979
6920  * bool
6921  * """
6922  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
6923  *
6924  *
6925  */
6926  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
6927  goto __pyx_L0;
6928 
6929  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967
6930  *
6931  *
6932  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
6933  * """
6934  * Cython equivalent of `isinstance(obj, np.timedelta64)`
6935  */
6936 
6937  /* function exit code */
6938  __pyx_L0:;
6939  __Pyx_RefNannyFinishContext();
6940  return __pyx_r;
6941 }
6942 
6943 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982
6944  *
6945  *
6946  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
6947  * """
6948  * Cython equivalent of `isinstance(obj, np.datetime64)`
6949  */
6950 
6951 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
6952  int __pyx_r;
6953  __Pyx_RefNannyDeclarations
6954  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
6955 
6956  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":994
6957  * bool
6958  * """
6959  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
6960  *
6961  *
6962  */
6963  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
6964  goto __pyx_L0;
6965 
6966  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982
6967  *
6968  *
6969  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
6970  * """
6971  * Cython equivalent of `isinstance(obj, np.datetime64)`
6972  */
6973 
6974  /* function exit code */
6975  __pyx_L0:;
6976  __Pyx_RefNannyFinishContext();
6977  return __pyx_r;
6978 }
6979 
6980 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997
6981  *
6982  *
6983  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
6984  * """
6985  * returns the int64 value underlying scalar numpy datetime64 object
6986  */
6987 
6988 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
6989  npy_datetime __pyx_r;
6990 
6991  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1004
6992  * also needed. That can be found using `get_datetime64_unit`.
6993  * """
6994  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
6995  *
6996  *
6997  */
6998  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
6999  goto __pyx_L0;
7000 
7001  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997
7002  *
7003  *
7004  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
7005  * """
7006  * returns the int64 value underlying scalar numpy datetime64 object
7007  */
7008 
7009  /* function exit code */
7010  __pyx_L0:;
7011  return __pyx_r;
7012 }
7013 
7014 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007
7015  *
7016  *
7017  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
7018  * """
7019  * returns the int64 value underlying scalar numpy timedelta64 object
7020  */
7021 
7022 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
7023  npy_timedelta __pyx_r;
7024 
7025  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1011
7026  * returns the int64 value underlying scalar numpy timedelta64 object
7027  * """
7028  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
7029  *
7030  *
7031  */
7032  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
7033  goto __pyx_L0;
7034 
7035  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007
7036  *
7037  *
7038  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
7039  * """
7040  * returns the int64 value underlying scalar numpy timedelta64 object
7041  */
7042 
7043  /* function exit code */
7044  __pyx_L0:;
7045  return __pyx_r;
7046 }
7047 
7048 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014
7049  *
7050  *
7051  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
7052  * """
7053  * returns the unit part of the dtype for a numpy datetime64 object.
7054  */
7055 
7056 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
7057  NPY_DATETIMEUNIT __pyx_r;
7058 
7059  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1018
7060  * returns the unit part of the dtype for a numpy datetime64 object.
7061  * """
7062  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
7063  */
7064  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
7065  goto __pyx_L0;
7066 
7067  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014
7068  *
7069  *
7070  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
7071  * """
7072  * returns the unit part of the dtype for a numpy datetime64 object.
7073  */
7074 
7075  /* function exit code */
7076  __pyx_L0:;
7077  return __pyx_r;
7078 }
7079 
7080 /* "View.MemoryView":122
7081  * cdef bint dtype_is_object
7082  *
7083  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7084  * mode="c", bint allocate_buffer=True):
7085  *
7086  */
7087 
7088 /* Python wrapper */
7089 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7090 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7091  PyObject *__pyx_v_shape = 0;
7092  Py_ssize_t __pyx_v_itemsize;
7093  PyObject *__pyx_v_format = 0;
7094  PyObject *__pyx_v_mode = 0;
7095  int __pyx_v_allocate_buffer;
7096  int __pyx_lineno = 0;
7097  const char *__pyx_filename = NULL;
7098  int __pyx_clineno = 0;
7099  int __pyx_r;
7100  __Pyx_RefNannyDeclarations
7101  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7102  {
7103  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
7104  PyObject* values[5] = {0,0,0,0,0};
7105  values[3] = ((PyObject *)__pyx_n_s_c);
7106  if (unlikely(__pyx_kwds)) {
7107  Py_ssize_t kw_args;
7108  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7109  switch (pos_args) {
7110  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7111  CYTHON_FALLTHROUGH;
7112  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7113  CYTHON_FALLTHROUGH;
7114  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7115  CYTHON_FALLTHROUGH;
7116  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7117  CYTHON_FALLTHROUGH;
7118  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7119  CYTHON_FALLTHROUGH;
7120  case 0: break;
7121  default: goto __pyx_L5_argtuple_error;
7122  }
7123  kw_args = PyDict_Size(__pyx_kwds);
7124  switch (pos_args) {
7125  case 0:
7126  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7127  else goto __pyx_L5_argtuple_error;
7128  CYTHON_FALLTHROUGH;
7129  case 1:
7130  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7131  else {
7132  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
7133  }
7134  CYTHON_FALLTHROUGH;
7135  case 2:
7136  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7137  else {
7138  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
7139  }
7140  CYTHON_FALLTHROUGH;
7141  case 3:
7142  if (kw_args > 0) {
7143  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7144  if (value) { values[3] = value; kw_args--; }
7145  }
7146  CYTHON_FALLTHROUGH;
7147  case 4:
7148  if (kw_args > 0) {
7149  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7150  if (value) { values[4] = value; kw_args--; }
7151  }
7152  }
7153  if (unlikely(kw_args > 0)) {
7154  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
7155  }
7156  } else {
7157  switch (PyTuple_GET_SIZE(__pyx_args)) {
7158  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7159  CYTHON_FALLTHROUGH;
7160  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7161  CYTHON_FALLTHROUGH;
7162  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7163  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7164  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7165  break;
7166  default: goto __pyx_L5_argtuple_error;
7167  }
7168  }
7169  __pyx_v_shape = ((PyObject*)values[0]);
7170  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
7171  __pyx_v_format = values[2];
7172  __pyx_v_mode = values[3];
7173  if (values[4]) {
7174  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
7175  } else {
7176 
7177  /* "View.MemoryView":123
7178  *
7179  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
7180  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
7181  *
7182  * cdef int idx
7183  */
7184  __pyx_v_allocate_buffer = ((int)1);
7185  }
7186  }
7187  goto __pyx_L4_argument_unpacking_done;
7188  __pyx_L5_argtuple_error:;
7189  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
7190  __pyx_L3_error:;
7191  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7192  __Pyx_RefNannyFinishContext();
7193  return -1;
7194  __pyx_L4_argument_unpacking_done:;
7195  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
7196  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7197  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
7198  }
7199  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
7200 
7201  /* "View.MemoryView":122
7202  * cdef bint dtype_is_object
7203  *
7204  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7205  * mode="c", bint allocate_buffer=True):
7206  *
7207  */
7208 
7209  /* function exit code */
7210  goto __pyx_L0;
7211  __pyx_L1_error:;
7212  __pyx_r = -1;
7213  __pyx_L0:;
7214  __Pyx_RefNannyFinishContext();
7215  return __pyx_r;
7216 }
7217 
7218 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
7219  int __pyx_v_idx;
7220  Py_ssize_t __pyx_v_i;
7221  Py_ssize_t __pyx_v_dim;
7222  PyObject **__pyx_v_p;
7223  char __pyx_v_order;
7224  int __pyx_r;
7225  __Pyx_RefNannyDeclarations
7226  Py_ssize_t __pyx_t_1;
7227  int __pyx_t_2;
7228  PyObject *__pyx_t_3 = NULL;
7229  int __pyx_t_4;
7230  PyObject *__pyx_t_5 = NULL;
7231  PyObject *__pyx_t_6 = NULL;
7232  char *__pyx_t_7;
7233  int __pyx_t_8;
7234  Py_ssize_t __pyx_t_9;
7235  PyObject *__pyx_t_10 = NULL;
7236  Py_ssize_t __pyx_t_11;
7237  int __pyx_lineno = 0;
7238  const char *__pyx_filename = NULL;
7239  int __pyx_clineno = 0;
7240  __Pyx_RefNannySetupContext("__cinit__", 0);
7241  __Pyx_INCREF(__pyx_v_format);
7242 
7243  /* "View.MemoryView":129
7244  * cdef PyObject **p
7245  *
7246  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
7247  * self.itemsize = itemsize
7248  *
7249  */
7250  if (unlikely(__pyx_v_shape == Py_None)) {
7251  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
7252  __PYX_ERR(1, 129, __pyx_L1_error)
7253  }
7254  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
7255  __pyx_v_self->ndim = ((int)__pyx_t_1);
7256 
7257  /* "View.MemoryView":130
7258  *
7259  * self.ndim = <int> len(shape)
7260  * self.itemsize = itemsize # <<<<<<<<<<<<<<
7261  *
7262  * if not self.ndim:
7263  */
7264  __pyx_v_self->itemsize = __pyx_v_itemsize;
7265 
7266  /* "View.MemoryView":132
7267  * self.itemsize = itemsize
7268  *
7269  * if not self.ndim: # <<<<<<<<<<<<<<
7270  * raise ValueError("Empty shape tuple for cython.array")
7271  *
7272  */
7273  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7274  if (unlikely(__pyx_t_2)) {
7275 
7276  /* "View.MemoryView":133
7277  *
7278  * if not self.ndim:
7279  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
7280  *
7281  * if itemsize <= 0:
7282  */
7283  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
7284  __Pyx_GOTREF(__pyx_t_3);
7285  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7286  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7287  __PYX_ERR(1, 133, __pyx_L1_error)
7288 
7289  /* "View.MemoryView":132
7290  * self.itemsize = itemsize
7291  *
7292  * if not self.ndim: # <<<<<<<<<<<<<<
7293  * raise ValueError("Empty shape tuple for cython.array")
7294  *
7295  */
7296  }
7297 
7298  /* "View.MemoryView":135
7299  * raise ValueError("Empty shape tuple for cython.array")
7300  *
7301  * if itemsize <= 0: # <<<<<<<<<<<<<<
7302  * raise ValueError("itemsize <= 0 for cython.array")
7303  *
7304  */
7305  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7306  if (unlikely(__pyx_t_2)) {
7307 
7308  /* "View.MemoryView":136
7309  *
7310  * if itemsize <= 0:
7311  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
7312  *
7313  * if not isinstance(format, bytes):
7314  */
7315  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
7316  __Pyx_GOTREF(__pyx_t_3);
7317  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7318  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7319  __PYX_ERR(1, 136, __pyx_L1_error)
7320 
7321  /* "View.MemoryView":135
7322  * raise ValueError("Empty shape tuple for cython.array")
7323  *
7324  * if itemsize <= 0: # <<<<<<<<<<<<<<
7325  * raise ValueError("itemsize <= 0 for cython.array")
7326  *
7327  */
7328  }
7329 
7330  /* "View.MemoryView":138
7331  * raise ValueError("itemsize <= 0 for cython.array")
7332  *
7333  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7334  * format = format.encode('ASCII')
7335  * self._format = format # keep a reference to the byte string
7336  */
7337  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7338  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7339  if (__pyx_t_4) {
7340 
7341  /* "View.MemoryView":139
7342  *
7343  * if not isinstance(format, bytes):
7344  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
7345  * self._format = format # keep a reference to the byte string
7346  * self.format = self._format
7347  */
7348  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
7349  __Pyx_GOTREF(__pyx_t_5);
7350  __pyx_t_6 = NULL;
7351  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7352  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7353  if (likely(__pyx_t_6)) {
7354  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7355  __Pyx_INCREF(__pyx_t_6);
7356  __Pyx_INCREF(function);
7357  __Pyx_DECREF_SET(__pyx_t_5, function);
7358  }
7359  }
7360  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
7361  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7362  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
7363  __Pyx_GOTREF(__pyx_t_3);
7364  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7365  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7366  __pyx_t_3 = 0;
7367 
7368  /* "View.MemoryView":138
7369  * raise ValueError("itemsize <= 0 for cython.array")
7370  *
7371  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7372  * format = format.encode('ASCII')
7373  * self._format = format # keep a reference to the byte string
7374  */
7375  }
7376 
7377  /* "View.MemoryView":140
7378  * if not isinstance(format, bytes):
7379  * format = format.encode('ASCII')
7380  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
7381  * self.format = self._format
7382  *
7383  */
7384  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
7385  __pyx_t_3 = __pyx_v_format;
7386  __Pyx_INCREF(__pyx_t_3);
7387  __Pyx_GIVEREF(__pyx_t_3);
7388  __Pyx_GOTREF(__pyx_v_self->_format);
7389  __Pyx_DECREF(__pyx_v_self->_format);
7390  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
7391  __pyx_t_3 = 0;
7392 
7393  /* "View.MemoryView":141
7394  * format = format.encode('ASCII')
7395  * self._format = format # keep a reference to the byte string
7396  * self.format = self._format # <<<<<<<<<<<<<<
7397  *
7398  *
7399  */
7400  if (unlikely(__pyx_v_self->_format == Py_None)) {
7401  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
7402  __PYX_ERR(1, 141, __pyx_L1_error)
7403  }
7404  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
7405  __pyx_v_self->format = __pyx_t_7;
7406 
7407  /* "View.MemoryView":144
7408  *
7409  *
7410  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
7411  * self._strides = self._shape + self.ndim
7412  *
7413  */
7414  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
7415 
7416  /* "View.MemoryView":145
7417  *
7418  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
7419  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
7420  *
7421  * if not self._shape:
7422  */
7423  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
7424 
7425  /* "View.MemoryView":147
7426  * self._strides = self._shape + self.ndim
7427  *
7428  * if not self._shape: # <<<<<<<<<<<<<<
7429  * raise MemoryError("unable to allocate shape and strides.")
7430  *
7431  */
7432  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
7433  if (unlikely(__pyx_t_4)) {
7434 
7435  /* "View.MemoryView":148
7436  *
7437  * if not self._shape:
7438  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
7439  *
7440  *
7441  */
7442  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
7443  __Pyx_GOTREF(__pyx_t_3);
7444  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7445  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7446  __PYX_ERR(1, 148, __pyx_L1_error)
7447 
7448  /* "View.MemoryView":147
7449  * self._strides = self._shape + self.ndim
7450  *
7451  * if not self._shape: # <<<<<<<<<<<<<<
7452  * raise MemoryError("unable to allocate shape and strides.")
7453  *
7454  */
7455  }
7456 
7457  /* "View.MemoryView":151
7458  *
7459  *
7460  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
7461  * if dim <= 0:
7462  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7463  */
7464  __pyx_t_8 = 0;
7465  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
7466  for (;;) {
7467  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
7468  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7469  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
7470  #else
7471  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
7472  __Pyx_GOTREF(__pyx_t_5);
7473  #endif
7474  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
7475  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7476  __pyx_v_dim = __pyx_t_9;
7477  __pyx_v_idx = __pyx_t_8;
7478  __pyx_t_8 = (__pyx_t_8 + 1);
7479 
7480  /* "View.MemoryView":152
7481  *
7482  * for idx, dim in enumerate(shape):
7483  * if dim <= 0: # <<<<<<<<<<<<<<
7484  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7485  * self._shape[idx] = dim
7486  */
7487  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
7488  if (unlikely(__pyx_t_4)) {
7489 
7490  /* "View.MemoryView":153
7491  * for idx, dim in enumerate(shape):
7492  * if dim <= 0:
7493  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
7494  * self._shape[idx] = dim
7495  *
7496  */
7497  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
7498  __Pyx_GOTREF(__pyx_t_5);
7499  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
7500  __Pyx_GOTREF(__pyx_t_6);
7501  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
7502  __Pyx_GOTREF(__pyx_t_10);
7503  __Pyx_GIVEREF(__pyx_t_5);
7504  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
7505  __Pyx_GIVEREF(__pyx_t_6);
7506  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
7507  __pyx_t_5 = 0;
7508  __pyx_t_6 = 0;
7509  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
7510  __Pyx_GOTREF(__pyx_t_6);
7511  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7512  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
7513  __Pyx_GOTREF(__pyx_t_10);
7514  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7515  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7516  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7517  __PYX_ERR(1, 153, __pyx_L1_error)
7518 
7519  /* "View.MemoryView":152
7520  *
7521  * for idx, dim in enumerate(shape):
7522  * if dim <= 0: # <<<<<<<<<<<<<<
7523  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7524  * self._shape[idx] = dim
7525  */
7526  }
7527 
7528  /* "View.MemoryView":154
7529  * if dim <= 0:
7530  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7531  * self._shape[idx] = dim # <<<<<<<<<<<<<<
7532  *
7533  * cdef char order
7534  */
7535  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
7536 
7537  /* "View.MemoryView":151
7538  *
7539  *
7540  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
7541  * if dim <= 0:
7542  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7543  */
7544  }
7545  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7546 
7547  /* "View.MemoryView":157
7548  *
7549  * cdef char order
7550  * if mode == 'fortran': # <<<<<<<<<<<<<<
7551  * order = b'F'
7552  * self.mode = u'fortran'
7553  */
7554  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
7555  if (__pyx_t_4) {
7556 
7557  /* "View.MemoryView":158
7558  * cdef char order
7559  * if mode == 'fortran':
7560  * order = b'F' # <<<<<<<<<<<<<<
7561  * self.mode = u'fortran'
7562  * elif mode == 'c':
7563  */
7564  __pyx_v_order = 'F';
7565 
7566  /* "View.MemoryView":159
7567  * if mode == 'fortran':
7568  * order = b'F'
7569  * self.mode = u'fortran' # <<<<<<<<<<<<<<
7570  * elif mode == 'c':
7571  * order = b'C'
7572  */
7573  __Pyx_INCREF(__pyx_n_u_fortran);
7574  __Pyx_GIVEREF(__pyx_n_u_fortran);
7575  __Pyx_GOTREF(__pyx_v_self->mode);
7576  __Pyx_DECREF(__pyx_v_self->mode);
7577  __pyx_v_self->mode = __pyx_n_u_fortran;
7578 
7579  /* "View.MemoryView":157
7580  *
7581  * cdef char order
7582  * if mode == 'fortran': # <<<<<<<<<<<<<<
7583  * order = b'F'
7584  * self.mode = u'fortran'
7585  */
7586  goto __pyx_L10;
7587  }
7588 
7589  /* "View.MemoryView":160
7590  * order = b'F'
7591  * self.mode = u'fortran'
7592  * elif mode == 'c': # <<<<<<<<<<<<<<
7593  * order = b'C'
7594  * self.mode = u'c'
7595  */
7596  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
7597  if (likely(__pyx_t_4)) {
7598 
7599  /* "View.MemoryView":161
7600  * self.mode = u'fortran'
7601  * elif mode == 'c':
7602  * order = b'C' # <<<<<<<<<<<<<<
7603  * self.mode = u'c'
7604  * else:
7605  */
7606  __pyx_v_order = 'C';
7607 
7608  /* "View.MemoryView":162
7609  * elif mode == 'c':
7610  * order = b'C'
7611  * self.mode = u'c' # <<<<<<<<<<<<<<
7612  * else:
7613  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
7614  */
7615  __Pyx_INCREF(__pyx_n_u_c);
7616  __Pyx_GIVEREF(__pyx_n_u_c);
7617  __Pyx_GOTREF(__pyx_v_self->mode);
7618  __Pyx_DECREF(__pyx_v_self->mode);
7619  __pyx_v_self->mode = __pyx_n_u_c;
7620 
7621  /* "View.MemoryView":160
7622  * order = b'F'
7623  * self.mode = u'fortran'
7624  * elif mode == 'c': # <<<<<<<<<<<<<<
7625  * order = b'C'
7626  * self.mode = u'c'
7627  */
7628  goto __pyx_L10;
7629  }
7630 
7631  /* "View.MemoryView":164
7632  * self.mode = u'c'
7633  * else:
7634  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
7635  *
7636  * self.len = fill_contig_strides_array(self._shape, self._strides,
7637  */
7638  /*else*/ {
7639  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
7640  __Pyx_GOTREF(__pyx_t_3);
7641  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
7642  __Pyx_GOTREF(__pyx_t_10);
7643  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7644  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7645  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7646  __PYX_ERR(1, 164, __pyx_L1_error)
7647  }
7648  __pyx_L10:;
7649 
7650  /* "View.MemoryView":166
7651  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
7652  *
7653  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
7654  * itemsize, self.ndim, order)
7655  *
7656  */
7657  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
7658 
7659  /* "View.MemoryView":169
7660  * itemsize, self.ndim, order)
7661  *
7662  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
7663  * self.dtype_is_object = format == b'O'
7664  * if allocate_buffer:
7665  */
7666  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
7667 
7668  /* "View.MemoryView":170
7669  *
7670  * self.free_data = allocate_buffer
7671  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
7672  * if allocate_buffer:
7673  *
7674  */
7675  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
7676  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
7677  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7678  __pyx_v_self->dtype_is_object = __pyx_t_4;
7679 
7680  /* "View.MemoryView":171
7681  * self.free_data = allocate_buffer
7682  * self.dtype_is_object = format == b'O'
7683  * if allocate_buffer: # <<<<<<<<<<<<<<
7684  *
7685  *
7686  */
7687  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
7688  if (__pyx_t_4) {
7689 
7690  /* "View.MemoryView":174
7691  *
7692  *
7693  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
7694  * if not self.data:
7695  * raise MemoryError("unable to allocate array data.")
7696  */
7697  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
7698 
7699  /* "View.MemoryView":175
7700  *
7701  * self.data = <char *>malloc(self.len)
7702  * if not self.data: # <<<<<<<<<<<<<<
7703  * raise MemoryError("unable to allocate array data.")
7704  *
7705  */
7706  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
7707  if (unlikely(__pyx_t_4)) {
7708 
7709  /* "View.MemoryView":176
7710  * self.data = <char *>malloc(self.len)
7711  * if not self.data:
7712  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
7713  *
7714  * if self.dtype_is_object:
7715  */
7716  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
7717  __Pyx_GOTREF(__pyx_t_10);
7718  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7719  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7720  __PYX_ERR(1, 176, __pyx_L1_error)
7721 
7722  /* "View.MemoryView":175
7723  *
7724  * self.data = <char *>malloc(self.len)
7725  * if not self.data: # <<<<<<<<<<<<<<
7726  * raise MemoryError("unable to allocate array data.")
7727  *
7728  */
7729  }
7730 
7731  /* "View.MemoryView":178
7732  * raise MemoryError("unable to allocate array data.")
7733  *
7734  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7735  * p = <PyObject **> self.data
7736  * for i in range(self.len / itemsize):
7737  */
7738  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
7739  if (__pyx_t_4) {
7740 
7741  /* "View.MemoryView":179
7742  *
7743  * if self.dtype_is_object:
7744  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
7745  * for i in range(self.len / itemsize):
7746  * p[i] = Py_None
7747  */
7748  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7749 
7750  /* "View.MemoryView":180
7751  * if self.dtype_is_object:
7752  * p = <PyObject **> self.data
7753  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
7754  * p[i] = Py_None
7755  * Py_INCREF(Py_None)
7756  */
7757  if (unlikely(__pyx_v_itemsize == 0)) {
7758  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
7759  __PYX_ERR(1, 180, __pyx_L1_error)
7760  }
7761  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7762  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
7763  __PYX_ERR(1, 180, __pyx_L1_error)
7764  }
7765  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
7766  __pyx_t_9 = __pyx_t_1;
7767  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
7768  __pyx_v_i = __pyx_t_11;
7769 
7770  /* "View.MemoryView":181
7771  * p = <PyObject **> self.data
7772  * for i in range(self.len / itemsize):
7773  * p[i] = Py_None # <<<<<<<<<<<<<<
7774  * Py_INCREF(Py_None)
7775  *
7776  */
7777  (__pyx_v_p[__pyx_v_i]) = Py_None;
7778 
7779  /* "View.MemoryView":182
7780  * for i in range(self.len / itemsize):
7781  * p[i] = Py_None
7782  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7783  *
7784  * @cname('getbuffer')
7785  */
7786  Py_INCREF(Py_None);
7787  }
7788 
7789  /* "View.MemoryView":178
7790  * raise MemoryError("unable to allocate array data.")
7791  *
7792  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7793  * p = <PyObject **> self.data
7794  * for i in range(self.len / itemsize):
7795  */
7796  }
7797 
7798  /* "View.MemoryView":171
7799  * self.free_data = allocate_buffer
7800  * self.dtype_is_object = format == b'O'
7801  * if allocate_buffer: # <<<<<<<<<<<<<<
7802  *
7803  *
7804  */
7805  }
7806 
7807  /* "View.MemoryView":122
7808  * cdef bint dtype_is_object
7809  *
7810  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7811  * mode="c", bint allocate_buffer=True):
7812  *
7813  */
7814 
7815  /* function exit code */
7816  __pyx_r = 0;
7817  goto __pyx_L0;
7818  __pyx_L1_error:;
7819  __Pyx_XDECREF(__pyx_t_3);
7820  __Pyx_XDECREF(__pyx_t_5);
7821  __Pyx_XDECREF(__pyx_t_6);
7822  __Pyx_XDECREF(__pyx_t_10);
7823  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7824  __pyx_r = -1;
7825  __pyx_L0:;
7826  __Pyx_XDECREF(__pyx_v_format);
7827  __Pyx_RefNannyFinishContext();
7828  return __pyx_r;
7829 }
7830 
7831 /* "View.MemoryView":185
7832  *
7833  * @cname('getbuffer')
7834  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
7835  * cdef int bufmode = -1
7836  * if self.mode == u"c":
7837  */
7838 
7839 /* Python wrapper */
7840 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
7841 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7842  int __pyx_r;
7843  __Pyx_RefNannyDeclarations
7844  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
7845  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
7846 
7847  /* function exit code */
7848  __Pyx_RefNannyFinishContext();
7849  return __pyx_r;
7850 }
7851 
7852 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7853  int __pyx_v_bufmode;
7854  int __pyx_r;
7855  __Pyx_RefNannyDeclarations
7856  int __pyx_t_1;
7857  int __pyx_t_2;
7858  PyObject *__pyx_t_3 = NULL;
7859  char *__pyx_t_4;
7860  Py_ssize_t __pyx_t_5;
7861  int __pyx_t_6;
7862  Py_ssize_t *__pyx_t_7;
7863  int __pyx_lineno = 0;
7864  const char *__pyx_filename = NULL;
7865  int __pyx_clineno = 0;
7866  if (__pyx_v_info == NULL) {
7867  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
7868  return -1;
7869  }
7870  __Pyx_RefNannySetupContext("__getbuffer__", 0);
7871  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7872  __Pyx_GIVEREF(__pyx_v_info->obj);
7873 
7874  /* "View.MemoryView":186
7875  * @cname('getbuffer')
7876  * def __getbuffer__(self, Py_buffer *info, int flags):
7877  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
7878  * if self.mode == u"c":
7879  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7880  */
7881  __pyx_v_bufmode = -1;
7882 
7883  /* "View.MemoryView":187
7884  * def __getbuffer__(self, Py_buffer *info, int flags):
7885  * cdef int bufmode = -1
7886  * if self.mode == u"c": # <<<<<<<<<<<<<<
7887  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7888  * elif self.mode == u"fortran":
7889  */
7890  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
7891  __pyx_t_2 = (__pyx_t_1 != 0);
7892  if (__pyx_t_2) {
7893 
7894  /* "View.MemoryView":188
7895  * cdef int bufmode = -1
7896  * if self.mode == u"c":
7897  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7898  * elif self.mode == u"fortran":
7899  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7900  */
7901  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7902 
7903  /* "View.MemoryView":187
7904  * def __getbuffer__(self, Py_buffer *info, int flags):
7905  * cdef int bufmode = -1
7906  * if self.mode == u"c": # <<<<<<<<<<<<<<
7907  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7908  * elif self.mode == u"fortran":
7909  */
7910  goto __pyx_L3;
7911  }
7912 
7913  /* "View.MemoryView":189
7914  * if self.mode == u"c":
7915  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7916  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
7917  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7918  * if not (flags & bufmode):
7919  */
7920  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
7921  __pyx_t_1 = (__pyx_t_2 != 0);
7922  if (__pyx_t_1) {
7923 
7924  /* "View.MemoryView":190
7925  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7926  * elif self.mode == u"fortran":
7927  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7928  * if not (flags & bufmode):
7929  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7930  */
7931  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7932 
7933  /* "View.MemoryView":189
7934  * if self.mode == u"c":
7935  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7936  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
7937  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7938  * if not (flags & bufmode):
7939  */
7940  }
7941  __pyx_L3:;
7942 
7943  /* "View.MemoryView":191
7944  * elif self.mode == u"fortran":
7945  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7946  * if not (flags & bufmode): # <<<<<<<<<<<<<<
7947  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7948  * info.buf = self.data
7949  */
7950  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
7951  if (unlikely(__pyx_t_1)) {
7952 
7953  /* "View.MemoryView":192
7954  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7955  * if not (flags & bufmode):
7956  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
7957  * info.buf = self.data
7958  * info.len = self.len
7959  */
7960  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
7961  __Pyx_GOTREF(__pyx_t_3);
7962  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7963  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7964  __PYX_ERR(1, 192, __pyx_L1_error)
7965 
7966  /* "View.MemoryView":191
7967  * elif self.mode == u"fortran":
7968  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7969  * if not (flags & bufmode): # <<<<<<<<<<<<<<
7970  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7971  * info.buf = self.data
7972  */
7973  }
7974 
7975  /* "View.MemoryView":193
7976  * if not (flags & bufmode):
7977  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7978  * info.buf = self.data # <<<<<<<<<<<<<<
7979  * info.len = self.len
7980  * info.ndim = self.ndim
7981  */
7982  __pyx_t_4 = __pyx_v_self->data;
7983  __pyx_v_info->buf = __pyx_t_4;
7984 
7985  /* "View.MemoryView":194
7986  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7987  * info.buf = self.data
7988  * info.len = self.len # <<<<<<<<<<<<<<
7989  * info.ndim = self.ndim
7990  * info.shape = self._shape
7991  */
7992  __pyx_t_5 = __pyx_v_self->len;
7993  __pyx_v_info->len = __pyx_t_5;
7994 
7995  /* "View.MemoryView":195
7996  * info.buf = self.data
7997  * info.len = self.len
7998  * info.ndim = self.ndim # <<<<<<<<<<<<<<
7999  * info.shape = self._shape
8000  * info.strides = self._strides
8001  */
8002  __pyx_t_6 = __pyx_v_self->ndim;
8003  __pyx_v_info->ndim = __pyx_t_6;
8004 
8005  /* "View.MemoryView":196
8006  * info.len = self.len
8007  * info.ndim = self.ndim
8008  * info.shape = self._shape # <<<<<<<<<<<<<<
8009  * info.strides = self._strides
8010  * info.suboffsets = NULL
8011  */
8012  __pyx_t_7 = __pyx_v_self->_shape;
8013  __pyx_v_info->shape = __pyx_t_7;
8014 
8015  /* "View.MemoryView":197
8016  * info.ndim = self.ndim
8017  * info.shape = self._shape
8018  * info.strides = self._strides # <<<<<<<<<<<<<<
8019  * info.suboffsets = NULL
8020  * info.itemsize = self.itemsize
8021  */
8022  __pyx_t_7 = __pyx_v_self->_strides;
8023  __pyx_v_info->strides = __pyx_t_7;
8024 
8025  /* "View.MemoryView":198
8026  * info.shape = self._shape
8027  * info.strides = self._strides
8028  * info.suboffsets = NULL # <<<<<<<<<<<<<<
8029  * info.itemsize = self.itemsize
8030  * info.readonly = 0
8031  */
8032  __pyx_v_info->suboffsets = NULL;
8033 
8034  /* "View.MemoryView":199
8035  * info.strides = self._strides
8036  * info.suboffsets = NULL
8037  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
8038  * info.readonly = 0
8039  *
8040  */
8041  __pyx_t_5 = __pyx_v_self->itemsize;
8042  __pyx_v_info->itemsize = __pyx_t_5;
8043 
8044  /* "View.MemoryView":200
8045  * info.suboffsets = NULL
8046  * info.itemsize = self.itemsize
8047  * info.readonly = 0 # <<<<<<<<<<<<<<
8048  *
8049  * if flags & PyBUF_FORMAT:
8050  */
8051  __pyx_v_info->readonly = 0;
8052 
8053  /* "View.MemoryView":202
8054  * info.readonly = 0
8055  *
8056  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8057  * info.format = self.format
8058  * else:
8059  */
8060  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8061  if (__pyx_t_1) {
8062 
8063  /* "View.MemoryView":203
8064  *
8065  * if flags & PyBUF_FORMAT:
8066  * info.format = self.format # <<<<<<<<<<<<<<
8067  * else:
8068  * info.format = NULL
8069  */
8070  __pyx_t_4 = __pyx_v_self->format;
8071  __pyx_v_info->format = __pyx_t_4;
8072 
8073  /* "View.MemoryView":202
8074  * info.readonly = 0
8075  *
8076  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8077  * info.format = self.format
8078  * else:
8079  */
8080  goto __pyx_L5;
8081  }
8082 
8083  /* "View.MemoryView":205
8084  * info.format = self.format
8085  * else:
8086  * info.format = NULL # <<<<<<<<<<<<<<
8087  *
8088  * info.obj = self
8089  */
8090  /*else*/ {
8091  __pyx_v_info->format = NULL;
8092  }
8093  __pyx_L5:;
8094 
8095  /* "View.MemoryView":207
8096  * info.format = NULL
8097  *
8098  * info.obj = self # <<<<<<<<<<<<<<
8099  *
8100  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8101  */
8102  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8103  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8104  __Pyx_GOTREF(__pyx_v_info->obj);
8105  __Pyx_DECREF(__pyx_v_info->obj);
8106  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8107 
8108  /* "View.MemoryView":185
8109  *
8110  * @cname('getbuffer')
8111  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8112  * cdef int bufmode = -1
8113  * if self.mode == u"c":
8114  */
8115 
8116  /* function exit code */
8117  __pyx_r = 0;
8118  goto __pyx_L0;
8119  __pyx_L1_error:;
8120  __Pyx_XDECREF(__pyx_t_3);
8121  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8122  __pyx_r = -1;
8123  if (__pyx_v_info->obj != NULL) {
8124  __Pyx_GOTREF(__pyx_v_info->obj);
8125  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8126  }
8127  goto __pyx_L2;
8128  __pyx_L0:;
8129  if (__pyx_v_info->obj == Py_None) {
8130  __Pyx_GOTREF(__pyx_v_info->obj);
8131  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8132  }
8133  __pyx_L2:;
8134  __Pyx_RefNannyFinishContext();
8135  return __pyx_r;
8136 }
8137 
8138 /* "View.MemoryView":211
8139  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8140  *
8141  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8142  * if self.callback_free_data != NULL:
8143  * self.callback_free_data(self.data)
8144  */
8145 
8146 /* Python wrapper */
8147 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
8148 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8149  __Pyx_RefNannyDeclarations
8150  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8151  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
8152 
8153  /* function exit code */
8154  __Pyx_RefNannyFinishContext();
8155 }
8156 
8157 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
8158  __Pyx_RefNannyDeclarations
8159  int __pyx_t_1;
8160  __Pyx_RefNannySetupContext("__dealloc__", 0);
8161 
8162  /* "View.MemoryView":212
8163  *
8164  * def __dealloc__(array self):
8165  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8166  * self.callback_free_data(self.data)
8167  * elif self.free_data:
8168  */
8169  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8170  if (__pyx_t_1) {
8171 
8172  /* "View.MemoryView":213
8173  * def __dealloc__(array self):
8174  * if self.callback_free_data != NULL:
8175  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
8176  * elif self.free_data:
8177  * if self.dtype_is_object:
8178  */
8179  __pyx_v_self->callback_free_data(__pyx_v_self->data);
8180 
8181  /* "View.MemoryView":212
8182  *
8183  * def __dealloc__(array self):
8184  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8185  * self.callback_free_data(self.data)
8186  * elif self.free_data:
8187  */
8188  goto __pyx_L3;
8189  }
8190 
8191  /* "View.MemoryView":214
8192  * if self.callback_free_data != NULL:
8193  * self.callback_free_data(self.data)
8194  * elif self.free_data: # <<<<<<<<<<<<<<
8195  * if self.dtype_is_object:
8196  * refcount_objects_in_slice(self.data, self._shape,
8197  */
8198  __pyx_t_1 = (__pyx_v_self->free_data != 0);
8199  if (__pyx_t_1) {
8200 
8201  /* "View.MemoryView":215
8202  * self.callback_free_data(self.data)
8203  * elif self.free_data:
8204  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8205  * refcount_objects_in_slice(self.data, self._shape,
8206  * self._strides, self.ndim, False)
8207  */
8208  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8209  if (__pyx_t_1) {
8210 
8211  /* "View.MemoryView":216
8212  * elif self.free_data:
8213  * if self.dtype_is_object:
8214  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
8215  * self._strides, self.ndim, False)
8216  * free(self.data)
8217  */
8218  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8219 
8220  /* "View.MemoryView":215
8221  * self.callback_free_data(self.data)
8222  * elif self.free_data:
8223  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8224  * refcount_objects_in_slice(self.data, self._shape,
8225  * self._strides, self.ndim, False)
8226  */
8227  }
8228 
8229  /* "View.MemoryView":218
8230  * refcount_objects_in_slice(self.data, self._shape,
8231  * self._strides, self.ndim, False)
8232  * free(self.data) # <<<<<<<<<<<<<<
8233  * PyObject_Free(self._shape)
8234  *
8235  */
8236  free(__pyx_v_self->data);
8237 
8238  /* "View.MemoryView":214
8239  * if self.callback_free_data != NULL:
8240  * self.callback_free_data(self.data)
8241  * elif self.free_data: # <<<<<<<<<<<<<<
8242  * if self.dtype_is_object:
8243  * refcount_objects_in_slice(self.data, self._shape,
8244  */
8245  }
8246  __pyx_L3:;
8247 
8248  /* "View.MemoryView":219
8249  * self._strides, self.ndim, False)
8250  * free(self.data)
8251  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
8252  *
8253  * @property
8254  */
8255  PyObject_Free(__pyx_v_self->_shape);
8256 
8257  /* "View.MemoryView":211
8258  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8259  *
8260  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8261  * if self.callback_free_data != NULL:
8262  * self.callback_free_data(self.data)
8263  */
8264 
8265  /* function exit code */
8266  __Pyx_RefNannyFinishContext();
8267 }
8268 
8269 /* "View.MemoryView":222
8270  *
8271  * @property
8272  * def memview(self): # <<<<<<<<<<<<<<
8273  * return self.get_memview()
8274  *
8275  */
8276 
8277 /* Python wrapper */
8278 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
8279 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8280  PyObject *__pyx_r = 0;
8281  __Pyx_RefNannyDeclarations
8282  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
8283  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
8284 
8285  /* function exit code */
8286  __Pyx_RefNannyFinishContext();
8287  return __pyx_r;
8288 }
8289 
8290 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
8291  PyObject *__pyx_r = NULL;
8292  __Pyx_RefNannyDeclarations
8293  PyObject *__pyx_t_1 = NULL;
8294  int __pyx_lineno = 0;
8295  const char *__pyx_filename = NULL;
8296  int __pyx_clineno = 0;
8297  __Pyx_RefNannySetupContext("__get__", 0);
8298 
8299  /* "View.MemoryView":223
8300  * @property
8301  * def memview(self):
8302  * return self.get_memview() # <<<<<<<<<<<<<<
8303  *
8304  * @cname('get_memview')
8305  */
8306  __Pyx_XDECREF(__pyx_r);
8307  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
8308  __Pyx_GOTREF(__pyx_t_1);
8309  __pyx_r = __pyx_t_1;
8310  __pyx_t_1 = 0;
8311  goto __pyx_L0;
8312 
8313  /* "View.MemoryView":222
8314  *
8315  * @property
8316  * def memview(self): # <<<<<<<<<<<<<<
8317  * return self.get_memview()
8318  *
8319  */
8320 
8321  /* function exit code */
8322  __pyx_L1_error:;
8323  __Pyx_XDECREF(__pyx_t_1);
8324  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8325  __pyx_r = NULL;
8326  __pyx_L0:;
8327  __Pyx_XGIVEREF(__pyx_r);
8328  __Pyx_RefNannyFinishContext();
8329  return __pyx_r;
8330 }
8331 
8332 /* "View.MemoryView":226
8333  *
8334  * @cname('get_memview')
8335  * cdef get_memview(self): # <<<<<<<<<<<<<<
8336  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8337  * return memoryview(self, flags, self.dtype_is_object)
8338  */
8339 
8340 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
8341  int __pyx_v_flags;
8342  PyObject *__pyx_r = NULL;
8343  __Pyx_RefNannyDeclarations
8344  PyObject *__pyx_t_1 = NULL;
8345  PyObject *__pyx_t_2 = NULL;
8346  PyObject *__pyx_t_3 = NULL;
8347  int __pyx_lineno = 0;
8348  const char *__pyx_filename = NULL;
8349  int __pyx_clineno = 0;
8350  __Pyx_RefNannySetupContext("get_memview", 0);
8351 
8352  /* "View.MemoryView":227
8353  * @cname('get_memview')
8354  * cdef get_memview(self):
8355  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
8356  * return memoryview(self, flags, self.dtype_is_object)
8357  *
8358  */
8359  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8360 
8361  /* "View.MemoryView":228
8362  * cdef get_memview(self):
8363  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8364  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
8365  *
8366  * def __len__(self):
8367  */
8368  __Pyx_XDECREF(__pyx_r);
8369  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
8370  __Pyx_GOTREF(__pyx_t_1);
8371  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8372  __Pyx_GOTREF(__pyx_t_2);
8373  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
8374  __Pyx_GOTREF(__pyx_t_3);
8375  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8376  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8377  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8378  __Pyx_GIVEREF(__pyx_t_1);
8379  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
8380  __Pyx_GIVEREF(__pyx_t_2);
8381  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
8382  __pyx_t_1 = 0;
8383  __pyx_t_2 = 0;
8384  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8385  __Pyx_GOTREF(__pyx_t_2);
8386  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8387  __pyx_r = __pyx_t_2;
8388  __pyx_t_2 = 0;
8389  goto __pyx_L0;
8390 
8391  /* "View.MemoryView":226
8392  *
8393  * @cname('get_memview')
8394  * cdef get_memview(self): # <<<<<<<<<<<<<<
8395  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8396  * return memoryview(self, flags, self.dtype_is_object)
8397  */
8398 
8399  /* function exit code */
8400  __pyx_L1_error:;
8401  __Pyx_XDECREF(__pyx_t_1);
8402  __Pyx_XDECREF(__pyx_t_2);
8403  __Pyx_XDECREF(__pyx_t_3);
8404  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
8405  __pyx_r = 0;
8406  __pyx_L0:;
8407  __Pyx_XGIVEREF(__pyx_r);
8408  __Pyx_RefNannyFinishContext();
8409  return __pyx_r;
8410 }
8411 
8412 /* "View.MemoryView":230
8413  * return memoryview(self, flags, self.dtype_is_object)
8414  *
8415  * def __len__(self): # <<<<<<<<<<<<<<
8416  * return self._shape[0]
8417  *
8418  */
8419 
8420 /* Python wrapper */
8421 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
8422 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
8423  Py_ssize_t __pyx_r;
8424  __Pyx_RefNannyDeclarations
8425  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
8426  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
8427 
8428  /* function exit code */
8429  __Pyx_RefNannyFinishContext();
8430  return __pyx_r;
8431 }
8432 
8433 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
8434  Py_ssize_t __pyx_r;
8435  __Pyx_RefNannyDeclarations
8436  __Pyx_RefNannySetupContext("__len__", 0);
8437 
8438  /* "View.MemoryView":231
8439  *
8440  * def __len__(self):
8441  * return self._shape[0] # <<<<<<<<<<<<<<
8442  *
8443  * def __getattr__(self, attr):
8444  */
8445  __pyx_r = (__pyx_v_self->_shape[0]);
8446  goto __pyx_L0;
8447 
8448  /* "View.MemoryView":230
8449  * return memoryview(self, flags, self.dtype_is_object)
8450  *
8451  * def __len__(self): # <<<<<<<<<<<<<<
8452  * return self._shape[0]
8453  *
8454  */
8455 
8456  /* function exit code */
8457  __pyx_L0:;
8458  __Pyx_RefNannyFinishContext();
8459  return __pyx_r;
8460 }
8461 
8462 /* "View.MemoryView":233
8463  * return self._shape[0]
8464  *
8465  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
8466  * return getattr(self.memview, attr)
8467  *
8468  */
8469 
8470 /* Python wrapper */
8471 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
8472 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
8473  PyObject *__pyx_r = 0;
8474  __Pyx_RefNannyDeclarations
8475  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
8476  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
8477 
8478  /* function exit code */
8479  __Pyx_RefNannyFinishContext();
8480  return __pyx_r;
8481 }
8482 
8483 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
8484  PyObject *__pyx_r = NULL;
8485  __Pyx_RefNannyDeclarations
8486  PyObject *__pyx_t_1 = NULL;
8487  PyObject *__pyx_t_2 = NULL;
8488  int __pyx_lineno = 0;
8489  const char *__pyx_filename = NULL;
8490  int __pyx_clineno = 0;
8491  __Pyx_RefNannySetupContext("__getattr__", 0);
8492 
8493  /* "View.MemoryView":234
8494  *
8495  * def __getattr__(self, attr):
8496  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
8497  *
8498  * def __getitem__(self, item):
8499  */
8500  __Pyx_XDECREF(__pyx_r);
8501  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
8502  __Pyx_GOTREF(__pyx_t_1);
8503  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
8504  __Pyx_GOTREF(__pyx_t_2);
8505  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8506  __pyx_r = __pyx_t_2;
8507  __pyx_t_2 = 0;
8508  goto __pyx_L0;
8509 
8510  /* "View.MemoryView":233
8511  * return self._shape[0]
8512  *
8513  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
8514  * return getattr(self.memview, attr)
8515  *
8516  */
8517 
8518  /* function exit code */
8519  __pyx_L1_error:;
8520  __Pyx_XDECREF(__pyx_t_1);
8521  __Pyx_XDECREF(__pyx_t_2);
8522  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8523  __pyx_r = NULL;
8524  __pyx_L0:;
8525  __Pyx_XGIVEREF(__pyx_r);
8526  __Pyx_RefNannyFinishContext();
8527  return __pyx_r;
8528 }
8529 
8530 /* "View.MemoryView":236
8531  * return getattr(self.memview, attr)
8532  *
8533  * def __getitem__(self, item): # <<<<<<<<<<<<<<
8534  * return self.memview[item]
8535  *
8536  */
8537 
8538 /* Python wrapper */
8539 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
8540 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
8541  PyObject *__pyx_r = 0;
8542  __Pyx_RefNannyDeclarations
8543  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8544  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
8545 
8546  /* function exit code */
8547  __Pyx_RefNannyFinishContext();
8548  return __pyx_r;
8549 }
8550 
8551 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
8552  PyObject *__pyx_r = NULL;
8553  __Pyx_RefNannyDeclarations
8554  PyObject *__pyx_t_1 = NULL;
8555  PyObject *__pyx_t_2 = NULL;
8556  int __pyx_lineno = 0;
8557  const char *__pyx_filename = NULL;
8558  int __pyx_clineno = 0;
8559  __Pyx_RefNannySetupContext("__getitem__", 0);
8560 
8561  /* "View.MemoryView":237
8562  *
8563  * def __getitem__(self, item):
8564  * return self.memview[item] # <<<<<<<<<<<<<<
8565  *
8566  * def __setitem__(self, item, value):
8567  */
8568  __Pyx_XDECREF(__pyx_r);
8569  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
8570  __Pyx_GOTREF(__pyx_t_1);
8571  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
8572  __Pyx_GOTREF(__pyx_t_2);
8573  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8574  __pyx_r = __pyx_t_2;
8575  __pyx_t_2 = 0;
8576  goto __pyx_L0;
8577 
8578  /* "View.MemoryView":236
8579  * return getattr(self.memview, attr)
8580  *
8581  * def __getitem__(self, item): # <<<<<<<<<<<<<<
8582  * return self.memview[item]
8583  *
8584  */
8585 
8586  /* function exit code */
8587  __pyx_L1_error:;
8588  __Pyx_XDECREF(__pyx_t_1);
8589  __Pyx_XDECREF(__pyx_t_2);
8590  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8591  __pyx_r = NULL;
8592  __pyx_L0:;
8593  __Pyx_XGIVEREF(__pyx_r);
8594  __Pyx_RefNannyFinishContext();
8595  return __pyx_r;
8596 }
8597 
8598 /* "View.MemoryView":239
8599  * return self.memview[item]
8600  *
8601  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
8602  * self.memview[item] = value
8603  *
8604  */
8605 
8606 /* Python wrapper */
8607 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
8608 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8609  int __pyx_r;
8610  __Pyx_RefNannyDeclarations
8611  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8612  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
8613 
8614  /* function exit code */
8615  __Pyx_RefNannyFinishContext();
8616  return __pyx_r;
8617 }
8618 
8619 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8620  int __pyx_r;
8621  __Pyx_RefNannyDeclarations
8622  PyObject *__pyx_t_1 = NULL;
8623  int __pyx_lineno = 0;
8624  const char *__pyx_filename = NULL;
8625  int __pyx_clineno = 0;
8626  __Pyx_RefNannySetupContext("__setitem__", 0);
8627 
8628  /* "View.MemoryView":240
8629  *
8630  * def __setitem__(self, item, value):
8631  * self.memview[item] = value # <<<<<<<<<<<<<<
8632  *
8633  *
8634  */
8635  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
8636  __Pyx_GOTREF(__pyx_t_1);
8637  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
8638  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8639 
8640  /* "View.MemoryView":239
8641  * return self.memview[item]
8642  *
8643  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
8644  * self.memview[item] = value
8645  *
8646  */
8647 
8648  /* function exit code */
8649  __pyx_r = 0;
8650  goto __pyx_L0;
8651  __pyx_L1_error:;
8652  __Pyx_XDECREF(__pyx_t_1);
8653  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8654  __pyx_r = -1;
8655  __pyx_L0:;
8656  __Pyx_RefNannyFinishContext();
8657  return __pyx_r;
8658 }
8659 
8660 /* "(tree fragment)":1
8661  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8662  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8663  * def __setstate_cython__(self, __pyx_state):
8664  */
8665 
8666 /* Python wrapper */
8667 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8668 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8669  PyObject *__pyx_r = 0;
8670  __Pyx_RefNannyDeclarations
8671  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8672  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
8673 
8674  /* function exit code */
8675  __Pyx_RefNannyFinishContext();
8676  return __pyx_r;
8677 }
8678 
8679 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
8680  PyObject *__pyx_r = NULL;
8681  __Pyx_RefNannyDeclarations
8682  PyObject *__pyx_t_1 = NULL;
8683  int __pyx_lineno = 0;
8684  const char *__pyx_filename = NULL;
8685  int __pyx_clineno = 0;
8686  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8687 
8688  /* "(tree fragment)":2
8689  * def __reduce_cython__(self):
8690  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8691  * def __setstate_cython__(self, __pyx_state):
8692  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8693  */
8694  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8695  __Pyx_GOTREF(__pyx_t_1);
8696  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8697  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8698  __PYX_ERR(1, 2, __pyx_L1_error)
8699 
8700  /* "(tree fragment)":1
8701  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8702  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8703  * def __setstate_cython__(self, __pyx_state):
8704  */
8705 
8706  /* function exit code */
8707  __pyx_L1_error:;
8708  __Pyx_XDECREF(__pyx_t_1);
8709  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8710  __pyx_r = NULL;
8711  __Pyx_XGIVEREF(__pyx_r);
8712  __Pyx_RefNannyFinishContext();
8713  return __pyx_r;
8714 }
8715 
8716 /* "(tree fragment)":3
8717  * def __reduce_cython__(self):
8718  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8719  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8720  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8721  */
8722 
8723 /* Python wrapper */
8724 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
8725 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8726  PyObject *__pyx_r = 0;
8727  __Pyx_RefNannyDeclarations
8728  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8729  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8730 
8731  /* function exit code */
8732  __Pyx_RefNannyFinishContext();
8733  return __pyx_r;
8734 }
8735 
8736 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8737  PyObject *__pyx_r = NULL;
8738  __Pyx_RefNannyDeclarations
8739  PyObject *__pyx_t_1 = NULL;
8740  int __pyx_lineno = 0;
8741  const char *__pyx_filename = NULL;
8742  int __pyx_clineno = 0;
8743  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8744 
8745  /* "(tree fragment)":4
8746  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8747  * def __setstate_cython__(self, __pyx_state):
8748  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8749  */
8750  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8751  __Pyx_GOTREF(__pyx_t_1);
8752  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8753  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8754  __PYX_ERR(1, 4, __pyx_L1_error)
8755 
8756  /* "(tree fragment)":3
8757  * def __reduce_cython__(self):
8758  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8759  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8760  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8761  */
8762 
8763  /* function exit code */
8764  __pyx_L1_error:;
8765  __Pyx_XDECREF(__pyx_t_1);
8766  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8767  __pyx_r = NULL;
8768  __Pyx_XGIVEREF(__pyx_r);
8769  __Pyx_RefNannyFinishContext();
8770  return __pyx_r;
8771 }
8772 
8773 /* "View.MemoryView":244
8774  *
8775  * @cname("__pyx_array_new")
8776  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
8777  * char *mode, char *buf):
8778  * cdef array result
8779  */
8780 
8781 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
8782  struct __pyx_array_obj *__pyx_v_result = 0;
8783  struct __pyx_array_obj *__pyx_r = NULL;
8784  __Pyx_RefNannyDeclarations
8785  int __pyx_t_1;
8786  PyObject *__pyx_t_2 = NULL;
8787  PyObject *__pyx_t_3 = NULL;
8788  PyObject *__pyx_t_4 = NULL;
8789  PyObject *__pyx_t_5 = NULL;
8790  int __pyx_lineno = 0;
8791  const char *__pyx_filename = NULL;
8792  int __pyx_clineno = 0;
8793  __Pyx_RefNannySetupContext("array_cwrapper", 0);
8794 
8795  /* "View.MemoryView":248
8796  * cdef array result
8797  *
8798  * if buf == NULL: # <<<<<<<<<<<<<<
8799  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8800  * else:
8801  */
8802  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
8803  if (__pyx_t_1) {
8804 
8805  /* "View.MemoryView":249
8806  *
8807  * if buf == NULL:
8808  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
8809  * else:
8810  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8811  */
8812  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
8813  __Pyx_GOTREF(__pyx_t_2);
8814  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
8815  __Pyx_GOTREF(__pyx_t_3);
8816  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
8817  __Pyx_GOTREF(__pyx_t_4);
8818  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
8819  __Pyx_GOTREF(__pyx_t_5);
8820  __Pyx_INCREF(__pyx_v_shape);
8821  __Pyx_GIVEREF(__pyx_v_shape);
8822  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8823  __Pyx_GIVEREF(__pyx_t_2);
8824  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8825  __Pyx_GIVEREF(__pyx_t_3);
8826  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8827  __Pyx_GIVEREF(__pyx_t_4);
8828  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8829  __pyx_t_2 = 0;
8830  __pyx_t_3 = 0;
8831  __pyx_t_4 = 0;
8832  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
8833  __Pyx_GOTREF(__pyx_t_4);
8834  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8835  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
8836  __pyx_t_4 = 0;
8837 
8838  /* "View.MemoryView":248
8839  * cdef array result
8840  *
8841  * if buf == NULL: # <<<<<<<<<<<<<<
8842  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8843  * else:
8844  */
8845  goto __pyx_L3;
8846  }
8847 
8848  /* "View.MemoryView":251
8849  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8850  * else:
8851  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8852  * allocate_buffer=False)
8853  * result.data = buf
8854  */
8855  /*else*/ {
8856  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
8857  __Pyx_GOTREF(__pyx_t_4);
8858  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
8859  __Pyx_GOTREF(__pyx_t_5);
8860  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
8861  __Pyx_GOTREF(__pyx_t_3);
8862  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
8863  __Pyx_GOTREF(__pyx_t_2);
8864  __Pyx_INCREF(__pyx_v_shape);
8865  __Pyx_GIVEREF(__pyx_v_shape);
8866  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
8867  __Pyx_GIVEREF(__pyx_t_4);
8868  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
8869  __Pyx_GIVEREF(__pyx_t_5);
8870  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8871  __Pyx_GIVEREF(__pyx_t_3);
8872  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
8873  __pyx_t_4 = 0;
8874  __pyx_t_5 = 0;
8875  __pyx_t_3 = 0;
8876 
8877  /* "View.MemoryView":252
8878  * else:
8879  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8880  * allocate_buffer=False) # <<<<<<<<<<<<<<
8881  * result.data = buf
8882  *
8883  */
8884  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
8885  __Pyx_GOTREF(__pyx_t_3);
8886  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
8887 
8888  /* "View.MemoryView":251
8889  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8890  * else:
8891  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8892  * allocate_buffer=False)
8893  * result.data = buf
8894  */
8895  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
8896  __Pyx_GOTREF(__pyx_t_5);
8897  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8898  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8899  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
8900  __pyx_t_5 = 0;
8901 
8902  /* "View.MemoryView":253
8903  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8904  * allocate_buffer=False)
8905  * result.data = buf # <<<<<<<<<<<<<<
8906  *
8907  * return result
8908  */
8909  __pyx_v_result->data = __pyx_v_buf;
8910  }
8911  __pyx_L3:;
8912 
8913  /* "View.MemoryView":255
8914  * result.data = buf
8915  *
8916  * return result # <<<<<<<<<<<<<<
8917  *
8918  *
8919  */
8920  __Pyx_XDECREF(((PyObject *)__pyx_r));
8921  __Pyx_INCREF(((PyObject *)__pyx_v_result));
8922  __pyx_r = __pyx_v_result;
8923  goto __pyx_L0;
8924 
8925  /* "View.MemoryView":244
8926  *
8927  * @cname("__pyx_array_new")
8928  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
8929  * char *mode, char *buf):
8930  * cdef array result
8931  */
8932 
8933  /* function exit code */
8934  __pyx_L1_error:;
8935  __Pyx_XDECREF(__pyx_t_2);
8936  __Pyx_XDECREF(__pyx_t_3);
8937  __Pyx_XDECREF(__pyx_t_4);
8938  __Pyx_XDECREF(__pyx_t_5);
8939  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8940  __pyx_r = 0;
8941  __pyx_L0:;
8942  __Pyx_XDECREF((PyObject *)__pyx_v_result);
8943  __Pyx_XGIVEREF((PyObject *)__pyx_r);
8944  __Pyx_RefNannyFinishContext();
8945  return __pyx_r;
8946 }
8947 
8948 /* "View.MemoryView":281
8949  * cdef class Enum(object):
8950  * cdef object name
8951  * def __init__(self, name): # <<<<<<<<<<<<<<
8952  * self.name = name
8953  * def __repr__(self):
8954  */
8955 
8956 /* Python wrapper */
8957 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8958 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8959  PyObject *__pyx_v_name = 0;
8960  int __pyx_lineno = 0;
8961  const char *__pyx_filename = NULL;
8962  int __pyx_clineno = 0;
8963  int __pyx_r;
8964  __Pyx_RefNannyDeclarations
8965  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
8966  {
8967  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
8968  PyObject* values[1] = {0};
8969  if (unlikely(__pyx_kwds)) {
8970  Py_ssize_t kw_args;
8971  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8972  switch (pos_args) {
8973  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8974  CYTHON_FALLTHROUGH;
8975  case 0: break;
8976  default: goto __pyx_L5_argtuple_error;
8977  }
8978  kw_args = PyDict_Size(__pyx_kwds);
8979  switch (pos_args) {
8980  case 0:
8981  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
8982  else goto __pyx_L5_argtuple_error;
8983  }
8984  if (unlikely(kw_args > 0)) {
8985  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
8986  }
8987  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
8988  goto __pyx_L5_argtuple_error;
8989  } else {
8990  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8991  }
8992  __pyx_v_name = values[0];
8993  }
8994  goto __pyx_L4_argument_unpacking_done;
8995  __pyx_L5_argtuple_error:;
8996  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
8997  __pyx_L3_error:;
8998  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8999  __Pyx_RefNannyFinishContext();
9000  return -1;
9001  __pyx_L4_argument_unpacking_done:;
9002  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9003 
9004  /* function exit code */
9005  __Pyx_RefNannyFinishContext();
9006  return __pyx_r;
9007 }
9008 
9009 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9010  int __pyx_r;
9011  __Pyx_RefNannyDeclarations
9012  __Pyx_RefNannySetupContext("__init__", 0);
9013 
9014  /* "View.MemoryView":282
9015  * cdef object name
9016  * def __init__(self, name):
9017  * self.name = name # <<<<<<<<<<<<<<
9018  * def __repr__(self):
9019  * return self.name
9020  */
9021  __Pyx_INCREF(__pyx_v_name);
9022  __Pyx_GIVEREF(__pyx_v_name);
9023  __Pyx_GOTREF(__pyx_v_self->name);
9024  __Pyx_DECREF(__pyx_v_self->name);
9025  __pyx_v_self->name = __pyx_v_name;
9026 
9027  /* "View.MemoryView":281
9028  * cdef class Enum(object):
9029  * cdef object name
9030  * def __init__(self, name): # <<<<<<<<<<<<<<
9031  * self.name = name
9032  * def __repr__(self):
9033  */
9034 
9035  /* function exit code */
9036  __pyx_r = 0;
9037  __Pyx_RefNannyFinishContext();
9038  return __pyx_r;
9039 }
9040 
9041 /* "View.MemoryView":283
9042  * def __init__(self, name):
9043  * self.name = name
9044  * def __repr__(self): # <<<<<<<<<<<<<<
9045  * return self.name
9046  *
9047  */
9048 
9049 /* Python wrapper */
9050 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
9051 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9052  PyObject *__pyx_r = 0;
9053  __Pyx_RefNannyDeclarations
9054  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
9055  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9056 
9057  /* function exit code */
9058  __Pyx_RefNannyFinishContext();
9059  return __pyx_r;
9060 }
9061 
9062 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9063  PyObject *__pyx_r = NULL;
9064  __Pyx_RefNannyDeclarations
9065  __Pyx_RefNannySetupContext("__repr__", 0);
9066 
9067  /* "View.MemoryView":284
9068  * self.name = name
9069  * def __repr__(self):
9070  * return self.name # <<<<<<<<<<<<<<
9071  *
9072  * cdef generic = Enum("<strided and direct or indirect>")
9073  */
9074  __Pyx_XDECREF(__pyx_r);
9075  __Pyx_INCREF(__pyx_v_self->name);
9076  __pyx_r = __pyx_v_self->name;
9077  goto __pyx_L0;
9078 
9079  /* "View.MemoryView":283
9080  * def __init__(self, name):
9081  * self.name = name
9082  * def __repr__(self): # <<<<<<<<<<<<<<
9083  * return self.name
9084  *
9085  */
9086 
9087  /* function exit code */
9088  __pyx_L0:;
9089  __Pyx_XGIVEREF(__pyx_r);
9090  __Pyx_RefNannyFinishContext();
9091  return __pyx_r;
9092 }
9093 
9094 /* "(tree fragment)":1
9095  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9096  * cdef tuple state
9097  * cdef object _dict
9098  */
9099 
9100 /* Python wrapper */
9101 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9102 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9103  PyObject *__pyx_r = 0;
9104  __Pyx_RefNannyDeclarations
9105  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9106  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9107 
9108  /* function exit code */
9109  __Pyx_RefNannyFinishContext();
9110  return __pyx_r;
9111 }
9112 
9113 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9114  PyObject *__pyx_v_state = 0;
9115  PyObject *__pyx_v__dict = 0;
9116  int __pyx_v_use_setstate;
9117  PyObject *__pyx_r = NULL;
9118  __Pyx_RefNannyDeclarations
9119  PyObject *__pyx_t_1 = NULL;
9120  int __pyx_t_2;
9121  int __pyx_t_3;
9122  PyObject *__pyx_t_4 = NULL;
9123  PyObject *__pyx_t_5 = NULL;
9124  int __pyx_lineno = 0;
9125  const char *__pyx_filename = NULL;
9126  int __pyx_clineno = 0;
9127  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9128 
9129  /* "(tree fragment)":5
9130  * cdef object _dict
9131  * cdef bint use_setstate
9132  * state = (self.name,) # <<<<<<<<<<<<<<
9133  * _dict = getattr(self, '__dict__', None)
9134  * if _dict is not None:
9135  */
9136  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9137  __Pyx_GOTREF(__pyx_t_1);
9138  __Pyx_INCREF(__pyx_v_self->name);
9139  __Pyx_GIVEREF(__pyx_v_self->name);
9140  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9141  __pyx_v_state = ((PyObject*)__pyx_t_1);
9142  __pyx_t_1 = 0;
9143 
9144  /* "(tree fragment)":6
9145  * cdef bint use_setstate
9146  * state = (self.name,)
9147  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
9148  * if _dict is not None:
9149  * state += (_dict,)
9150  */
9151  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9152  __Pyx_GOTREF(__pyx_t_1);
9153  __pyx_v__dict = __pyx_t_1;
9154  __pyx_t_1 = 0;
9155 
9156  /* "(tree fragment)":7
9157  * state = (self.name,)
9158  * _dict = getattr(self, '__dict__', None)
9159  * if _dict is not None: # <<<<<<<<<<<<<<
9160  * state += (_dict,)
9161  * use_setstate = True
9162  */
9163  __pyx_t_2 = (__pyx_v__dict != Py_None);
9164  __pyx_t_3 = (__pyx_t_2 != 0);
9165  if (__pyx_t_3) {
9166 
9167  /* "(tree fragment)":8
9168  * _dict = getattr(self, '__dict__', None)
9169  * if _dict is not None:
9170  * state += (_dict,) # <<<<<<<<<<<<<<
9171  * use_setstate = True
9172  * else:
9173  */
9174  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9175  __Pyx_GOTREF(__pyx_t_1);
9176  __Pyx_INCREF(__pyx_v__dict);
9177  __Pyx_GIVEREF(__pyx_v__dict);
9178  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9179  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9180  __Pyx_GOTREF(__pyx_t_4);
9181  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9182  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9183  __pyx_t_4 = 0;
9184 
9185  /* "(tree fragment)":9
9186  * if _dict is not None:
9187  * state += (_dict,)
9188  * use_setstate = True # <<<<<<<<<<<<<<
9189  * else:
9190  * use_setstate = self.name is not None
9191  */
9192  __pyx_v_use_setstate = 1;
9193 
9194  /* "(tree fragment)":7
9195  * state = (self.name,)
9196  * _dict = getattr(self, '__dict__', None)
9197  * if _dict is not None: # <<<<<<<<<<<<<<
9198  * state += (_dict,)
9199  * use_setstate = True
9200  */
9201  goto __pyx_L3;
9202  }
9203 
9204  /* "(tree fragment)":11
9205  * use_setstate = True
9206  * else:
9207  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
9208  * if use_setstate:
9209  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9210  */
9211  /*else*/ {
9212  __pyx_t_3 = (__pyx_v_self->name != Py_None);
9213  __pyx_v_use_setstate = __pyx_t_3;
9214  }
9215  __pyx_L3:;
9216 
9217  /* "(tree fragment)":12
9218  * else:
9219  * use_setstate = self.name is not None
9220  * if use_setstate: # <<<<<<<<<<<<<<
9221  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9222  * else:
9223  */
9224  __pyx_t_3 = (__pyx_v_use_setstate != 0);
9225  if (__pyx_t_3) {
9226 
9227  /* "(tree fragment)":13
9228  * use_setstate = self.name is not None
9229  * if use_setstate:
9230  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
9231  * else:
9232  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9233  */
9234  __Pyx_XDECREF(__pyx_r);
9235  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9236  __Pyx_GOTREF(__pyx_t_4);
9237  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
9238  __Pyx_GOTREF(__pyx_t_1);
9239  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9240  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9241  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9242  __Pyx_INCREF(__pyx_int_184977713);
9243  __Pyx_GIVEREF(__pyx_int_184977713);
9244  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9245  __Pyx_INCREF(Py_None);
9246  __Pyx_GIVEREF(Py_None);
9247  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9248  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9249  __Pyx_GOTREF(__pyx_t_5);
9250  __Pyx_GIVEREF(__pyx_t_4);
9251  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9252  __Pyx_GIVEREF(__pyx_t_1);
9253  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9254  __Pyx_INCREF(__pyx_v_state);
9255  __Pyx_GIVEREF(__pyx_v_state);
9256  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9257  __pyx_t_4 = 0;
9258  __pyx_t_1 = 0;
9259  __pyx_r = __pyx_t_5;
9260  __pyx_t_5 = 0;
9261  goto __pyx_L0;
9262 
9263  /* "(tree fragment)":12
9264  * else:
9265  * use_setstate = self.name is not None
9266  * if use_setstate: # <<<<<<<<<<<<<<
9267  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9268  * else:
9269  */
9270  }
9271 
9272  /* "(tree fragment)":15
9273  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9274  * else:
9275  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
9276  * def __setstate_cython__(self, __pyx_state):
9277  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9278  */
9279  /*else*/ {
9280  __Pyx_XDECREF(__pyx_r);
9281  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9282  __Pyx_GOTREF(__pyx_t_5);
9283  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
9284  __Pyx_GOTREF(__pyx_t_1);
9285  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9286  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9287  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9288  __Pyx_INCREF(__pyx_int_184977713);
9289  __Pyx_GIVEREF(__pyx_int_184977713);
9290  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9291  __Pyx_INCREF(__pyx_v_state);
9292  __Pyx_GIVEREF(__pyx_v_state);
9293  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9294  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9295  __Pyx_GOTREF(__pyx_t_4);
9296  __Pyx_GIVEREF(__pyx_t_5);
9297  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9298  __Pyx_GIVEREF(__pyx_t_1);
9299  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9300  __pyx_t_5 = 0;
9301  __pyx_t_1 = 0;
9302  __pyx_r = __pyx_t_4;
9303  __pyx_t_4 = 0;
9304  goto __pyx_L0;
9305  }
9306 
9307  /* "(tree fragment)":1
9308  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9309  * cdef tuple state
9310  * cdef object _dict
9311  */
9312 
9313  /* function exit code */
9314  __pyx_L1_error:;
9315  __Pyx_XDECREF(__pyx_t_1);
9316  __Pyx_XDECREF(__pyx_t_4);
9317  __Pyx_XDECREF(__pyx_t_5);
9318  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9319  __pyx_r = NULL;
9320  __pyx_L0:;
9321  __Pyx_XDECREF(__pyx_v_state);
9322  __Pyx_XDECREF(__pyx_v__dict);
9323  __Pyx_XGIVEREF(__pyx_r);
9324  __Pyx_RefNannyFinishContext();
9325  return __pyx_r;
9326 }
9327 
9328 /* "(tree fragment)":16
9329  * else:
9330  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9331  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9332  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9333  */
9334 
9335 /* Python wrapper */
9336 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9337 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9338  PyObject *__pyx_r = 0;
9339  __Pyx_RefNannyDeclarations
9340  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9341  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9342 
9343  /* function exit code */
9344  __Pyx_RefNannyFinishContext();
9345  return __pyx_r;
9346 }
9347 
9348 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9349  PyObject *__pyx_r = NULL;
9350  __Pyx_RefNannyDeclarations
9351  PyObject *__pyx_t_1 = NULL;
9352  int __pyx_lineno = 0;
9353  const char *__pyx_filename = NULL;
9354  int __pyx_clineno = 0;
9355  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9356 
9357  /* "(tree fragment)":17
9358  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9359  * def __setstate_cython__(self, __pyx_state):
9360  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
9361  */
9362  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9363  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9364  __Pyx_GOTREF(__pyx_t_1);
9365  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9366 
9367  /* "(tree fragment)":16
9368  * else:
9369  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9370  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9371  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9372  */
9373 
9374  /* function exit code */
9375  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9376  goto __pyx_L0;
9377  __pyx_L1_error:;
9378  __Pyx_XDECREF(__pyx_t_1);
9379  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9380  __pyx_r = NULL;
9381  __pyx_L0:;
9382  __Pyx_XGIVEREF(__pyx_r);
9383  __Pyx_RefNannyFinishContext();
9384  return __pyx_r;
9385 }
9386 
9387 /* "View.MemoryView":298
9388  *
9389  * @cname('__pyx_align_pointer')
9390  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
9391  * "Align pointer memory on a given boundary"
9392  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9393  */
9394 
9395 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
9396  Py_intptr_t __pyx_v_aligned_p;
9397  size_t __pyx_v_offset;
9398  void *__pyx_r;
9399  int __pyx_t_1;
9400 
9401  /* "View.MemoryView":300
9402  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
9403  * "Align pointer memory on a given boundary"
9404  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
9405  * cdef size_t offset
9406  *
9407  */
9408  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
9409 
9410  /* "View.MemoryView":304
9411  *
9412  * with cython.cdivision(True):
9413  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
9414  *
9415  * if offset > 0:
9416  */
9417  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
9418 
9419  /* "View.MemoryView":306
9420  * offset = aligned_p % alignment
9421  *
9422  * if offset > 0: # <<<<<<<<<<<<<<
9423  * aligned_p += alignment - offset
9424  *
9425  */
9426  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
9427  if (__pyx_t_1) {
9428 
9429  /* "View.MemoryView":307
9430  *
9431  * if offset > 0:
9432  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
9433  *
9434  * return <void *> aligned_p
9435  */
9436  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
9437 
9438  /* "View.MemoryView":306
9439  * offset = aligned_p % alignment
9440  *
9441  * if offset > 0: # <<<<<<<<<<<<<<
9442  * aligned_p += alignment - offset
9443  *
9444  */
9445  }
9446 
9447  /* "View.MemoryView":309
9448  * aligned_p += alignment - offset
9449  *
9450  * return <void *> aligned_p # <<<<<<<<<<<<<<
9451  *
9452  *
9453  */
9454  __pyx_r = ((void *)__pyx_v_aligned_p);
9455  goto __pyx_L0;
9456 
9457  /* "View.MemoryView":298
9458  *
9459  * @cname('__pyx_align_pointer')
9460  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
9461  * "Align pointer memory on a given boundary"
9462  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9463  */
9464 
9465  /* function exit code */
9466  __pyx_L0:;
9467  return __pyx_r;
9468 }
9469 
9470 /* "View.MemoryView":345
9471  * cdef __Pyx_TypeInfo *typeinfo
9472  *
9473  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9474  * self.obj = obj
9475  * self.flags = flags
9476  */
9477 
9478 /* Python wrapper */
9479 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9480 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9481  PyObject *__pyx_v_obj = 0;
9482  int __pyx_v_flags;
9483  int __pyx_v_dtype_is_object;
9484  int __pyx_lineno = 0;
9485  const char *__pyx_filename = NULL;
9486  int __pyx_clineno = 0;
9487  int __pyx_r;
9488  __Pyx_RefNannyDeclarations
9489  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
9490  {
9491  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
9492  PyObject* values[3] = {0,0,0};
9493  if (unlikely(__pyx_kwds)) {
9494  Py_ssize_t kw_args;
9495  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9496  switch (pos_args) {
9497  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9498  CYTHON_FALLTHROUGH;
9499  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9500  CYTHON_FALLTHROUGH;
9501  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9502  CYTHON_FALLTHROUGH;
9503  case 0: break;
9504  default: goto __pyx_L5_argtuple_error;
9505  }
9506  kw_args = PyDict_Size(__pyx_kwds);
9507  switch (pos_args) {
9508  case 0:
9509  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
9510  else goto __pyx_L5_argtuple_error;
9511  CYTHON_FALLTHROUGH;
9512  case 1:
9513  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
9514  else {
9515  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
9516  }
9517  CYTHON_FALLTHROUGH;
9518  case 2:
9519  if (kw_args > 0) {
9520  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
9521  if (value) { values[2] = value; kw_args--; }
9522  }
9523  }
9524  if (unlikely(kw_args > 0)) {
9525  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
9526  }
9527  } else {
9528  switch (PyTuple_GET_SIZE(__pyx_args)) {
9529  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9530  CYTHON_FALLTHROUGH;
9531  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9532  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9533  break;
9534  default: goto __pyx_L5_argtuple_error;
9535  }
9536  }
9537  __pyx_v_obj = values[0];
9538  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
9539  if (values[2]) {
9540  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
9541  } else {
9542  __pyx_v_dtype_is_object = ((int)0);
9543  }
9544  }
9545  goto __pyx_L4_argument_unpacking_done;
9546  __pyx_L5_argtuple_error:;
9547  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
9548  __pyx_L3_error:;
9549  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9550  __Pyx_RefNannyFinishContext();
9551  return -1;
9552  __pyx_L4_argument_unpacking_done:;
9553  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
9554 
9555  /* function exit code */
9556  __Pyx_RefNannyFinishContext();
9557  return __pyx_r;
9558 }
9559 
9560 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
9561  int __pyx_r;
9562  __Pyx_RefNannyDeclarations
9563  int __pyx_t_1;
9564  int __pyx_t_2;
9565  int __pyx_t_3;
9566  int __pyx_t_4;
9567  int __pyx_lineno = 0;
9568  const char *__pyx_filename = NULL;
9569  int __pyx_clineno = 0;
9570  __Pyx_RefNannySetupContext("__cinit__", 0);
9571 
9572  /* "View.MemoryView":346
9573  *
9574  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9575  * self.obj = obj # <<<<<<<<<<<<<<
9576  * self.flags = flags
9577  * if type(self) is memoryview or obj is not None:
9578  */
9579  __Pyx_INCREF(__pyx_v_obj);
9580  __Pyx_GIVEREF(__pyx_v_obj);
9581  __Pyx_GOTREF(__pyx_v_self->obj);
9582  __Pyx_DECREF(__pyx_v_self->obj);
9583  __pyx_v_self->obj = __pyx_v_obj;
9584 
9585  /* "View.MemoryView":347
9586  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9587  * self.obj = obj
9588  * self.flags = flags # <<<<<<<<<<<<<<
9589  * if type(self) is memoryview or obj is not None:
9590  * __Pyx_GetBuffer(obj, &self.view, flags)
9591  */
9592  __pyx_v_self->flags = __pyx_v_flags;
9593 
9594  /* "View.MemoryView":348
9595  * self.obj = obj
9596  * self.flags = flags
9597  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9598  * __Pyx_GetBuffer(obj, &self.view, flags)
9599  * if <PyObject *> self.view.obj == NULL:
9600  */
9601  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9602  __pyx_t_3 = (__pyx_t_2 != 0);
9603  if (!__pyx_t_3) {
9604  } else {
9605  __pyx_t_1 = __pyx_t_3;
9606  goto __pyx_L4_bool_binop_done;
9607  }
9608  __pyx_t_3 = (__pyx_v_obj != Py_None);
9609  __pyx_t_2 = (__pyx_t_3 != 0);
9610  __pyx_t_1 = __pyx_t_2;
9611  __pyx_L4_bool_binop_done:;
9612  if (__pyx_t_1) {
9613 
9614  /* "View.MemoryView":349
9615  * self.flags = flags
9616  * if type(self) is memoryview or obj is not None:
9617  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
9618  * if <PyObject *> self.view.obj == NULL:
9619  * (<__pyx_buffer *> &self.view).obj = Py_None
9620  */
9621  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
9622 
9623  /* "View.MemoryView":350
9624  * if type(self) is memoryview or obj is not None:
9625  * __Pyx_GetBuffer(obj, &self.view, flags)
9626  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9627  * (<__pyx_buffer *> &self.view).obj = Py_None
9628  * Py_INCREF(Py_None)
9629  */
9630  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
9631  if (__pyx_t_1) {
9632 
9633  /* "View.MemoryView":351
9634  * __Pyx_GetBuffer(obj, &self.view, flags)
9635  * if <PyObject *> self.view.obj == NULL:
9636  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
9637  * Py_INCREF(Py_None)
9638  *
9639  */
9640  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9641 
9642  /* "View.MemoryView":352
9643  * if <PyObject *> self.view.obj == NULL:
9644  * (<__pyx_buffer *> &self.view).obj = Py_None
9645  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9646  *
9647  * global __pyx_memoryview_thread_locks_used
9648  */
9649  Py_INCREF(Py_None);
9650 
9651  /* "View.MemoryView":350
9652  * if type(self) is memoryview or obj is not None:
9653  * __Pyx_GetBuffer(obj, &self.view, flags)
9654  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9655  * (<__pyx_buffer *> &self.view).obj = Py_None
9656  * Py_INCREF(Py_None)
9657  */
9658  }
9659 
9660  /* "View.MemoryView":348
9661  * self.obj = obj
9662  * self.flags = flags
9663  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9664  * __Pyx_GetBuffer(obj, &self.view, flags)
9665  * if <PyObject *> self.view.obj == NULL:
9666  */
9667  }
9668 
9669  /* "View.MemoryView":355
9670  *
9671  * global __pyx_memoryview_thread_locks_used
9672  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
9673  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9674  * __pyx_memoryview_thread_locks_used += 1
9675  */
9676  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
9677  if (__pyx_t_1) {
9678 
9679  /* "View.MemoryView":356
9680  * global __pyx_memoryview_thread_locks_used
9681  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9682  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
9683  * __pyx_memoryview_thread_locks_used += 1
9684  * if self.lock is NULL:
9685  */
9686  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9687 
9688  /* "View.MemoryView":357
9689  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9690  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9691  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
9692  * if self.lock is NULL:
9693  * self.lock = PyThread_allocate_lock()
9694  */
9695  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9696 
9697  /* "View.MemoryView":355
9698  *
9699  * global __pyx_memoryview_thread_locks_used
9700  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
9701  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9702  * __pyx_memoryview_thread_locks_used += 1
9703  */
9704  }
9705 
9706  /* "View.MemoryView":358
9707  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9708  * __pyx_memoryview_thread_locks_used += 1
9709  * if self.lock is NULL: # <<<<<<<<<<<<<<
9710  * self.lock = PyThread_allocate_lock()
9711  * if self.lock is NULL:
9712  */
9713  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9714  if (__pyx_t_1) {
9715 
9716  /* "View.MemoryView":359
9717  * __pyx_memoryview_thread_locks_used += 1
9718  * if self.lock is NULL:
9719  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
9720  * if self.lock is NULL:
9721  * raise MemoryError
9722  */
9723  __pyx_v_self->lock = PyThread_allocate_lock();
9724 
9725  /* "View.MemoryView":360
9726  * if self.lock is NULL:
9727  * self.lock = PyThread_allocate_lock()
9728  * if self.lock is NULL: # <<<<<<<<<<<<<<
9729  * raise MemoryError
9730  *
9731  */
9732  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9733  if (unlikely(__pyx_t_1)) {
9734 
9735  /* "View.MemoryView":361
9736  * self.lock = PyThread_allocate_lock()
9737  * if self.lock is NULL:
9738  * raise MemoryError # <<<<<<<<<<<<<<
9739  *
9740  * if flags & PyBUF_FORMAT:
9741  */
9742  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
9743 
9744  /* "View.MemoryView":360
9745  * if self.lock is NULL:
9746  * self.lock = PyThread_allocate_lock()
9747  * if self.lock is NULL: # <<<<<<<<<<<<<<
9748  * raise MemoryError
9749  *
9750  */
9751  }
9752 
9753  /* "View.MemoryView":358
9754  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9755  * __pyx_memoryview_thread_locks_used += 1
9756  * if self.lock is NULL: # <<<<<<<<<<<<<<
9757  * self.lock = PyThread_allocate_lock()
9758  * if self.lock is NULL:
9759  */
9760  }
9761 
9762  /* "View.MemoryView":363
9763  * raise MemoryError
9764  *
9765  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9766  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9767  * else:
9768  */
9769  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9770  if (__pyx_t_1) {
9771 
9772  /* "View.MemoryView":364
9773  *
9774  * if flags & PyBUF_FORMAT:
9775  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
9776  * else:
9777  * self.dtype_is_object = dtype_is_object
9778  */
9779  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
9780  if (__pyx_t_2) {
9781  } else {
9782  __pyx_t_1 = __pyx_t_2;
9783  goto __pyx_L11_bool_binop_done;
9784  }
9785  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
9786  __pyx_t_1 = __pyx_t_2;
9787  __pyx_L11_bool_binop_done:;
9788  __pyx_v_self->dtype_is_object = __pyx_t_1;
9789 
9790  /* "View.MemoryView":363
9791  * raise MemoryError
9792  *
9793  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9794  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9795  * else:
9796  */
9797  goto __pyx_L10;
9798  }
9799 
9800  /* "View.MemoryView":366
9801  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9802  * else:
9803  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
9804  *
9805  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9806  */
9807  /*else*/ {
9808  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
9809  }
9810  __pyx_L10:;
9811 
9812  /* "View.MemoryView":368
9813  * self.dtype_is_object = dtype_is_object
9814  *
9815  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
9816  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9817  * self.typeinfo = NULL
9818  */
9819  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
9820 
9821  /* "View.MemoryView":370
9822  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9823  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9824  * self.typeinfo = NULL # <<<<<<<<<<<<<<
9825  *
9826  * def __dealloc__(memoryview self):
9827  */
9828  __pyx_v_self->typeinfo = NULL;
9829 
9830  /* "View.MemoryView":345
9831  * cdef __Pyx_TypeInfo *typeinfo
9832  *
9833  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9834  * self.obj = obj
9835  * self.flags = flags
9836  */
9837 
9838  /* function exit code */
9839  __pyx_r = 0;
9840  goto __pyx_L0;
9841  __pyx_L1_error:;
9842  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9843  __pyx_r = -1;
9844  __pyx_L0:;
9845  __Pyx_RefNannyFinishContext();
9846  return __pyx_r;
9847 }
9848 
9849 /* "View.MemoryView":372
9850  * self.typeinfo = NULL
9851  *
9852  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9853  * if self.obj is not None:
9854  * __Pyx_ReleaseBuffer(&self.view)
9855  */
9856 
9857 /* Python wrapper */
9858 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
9859 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
9860  __Pyx_RefNannyDeclarations
9861  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9862  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
9863 
9864  /* function exit code */
9865  __Pyx_RefNannyFinishContext();
9866 }
9867 
9868 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
9869  int __pyx_v_i;
9870  __Pyx_RefNannyDeclarations
9871  int __pyx_t_1;
9872  int __pyx_t_2;
9873  int __pyx_t_3;
9874  int __pyx_t_4;
9875  int __pyx_t_5;
9876  PyThread_type_lock __pyx_t_6;
9877  PyThread_type_lock __pyx_t_7;
9878  __Pyx_RefNannySetupContext("__dealloc__", 0);
9879 
9880  /* "View.MemoryView":373
9881  *
9882  * def __dealloc__(memoryview self):
9883  * if self.obj is not None: # <<<<<<<<<<<<<<
9884  * __Pyx_ReleaseBuffer(&self.view)
9885  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9886  */
9887  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9888  __pyx_t_2 = (__pyx_t_1 != 0);
9889  if (__pyx_t_2) {
9890 
9891  /* "View.MemoryView":374
9892  * def __dealloc__(memoryview self):
9893  * if self.obj is not None:
9894  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
9895  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9896  *
9897  */
9898  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
9899 
9900  /* "View.MemoryView":373
9901  *
9902  * def __dealloc__(memoryview self):
9903  * if self.obj is not None: # <<<<<<<<<<<<<<
9904  * __Pyx_ReleaseBuffer(&self.view)
9905  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9906  */
9907  goto __pyx_L3;
9908  }
9909 
9910  /* "View.MemoryView":375
9911  * if self.obj is not None:
9912  * __Pyx_ReleaseBuffer(&self.view)
9913  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9914  *
9915  * (<__pyx_buffer *> &self.view).obj = NULL
9916  */
9917  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
9918  if (__pyx_t_2) {
9919 
9920  /* "View.MemoryView":377
9921  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9922  *
9923  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
9924  * Py_DECREF(Py_None)
9925  *
9926  */
9927  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
9928 
9929  /* "View.MemoryView":378
9930  *
9931  * (<__pyx_buffer *> &self.view).obj = NULL
9932  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
9933  *
9934  * cdef int i
9935  */
9936  Py_DECREF(Py_None);
9937 
9938  /* "View.MemoryView":375
9939  * if self.obj is not None:
9940  * __Pyx_ReleaseBuffer(&self.view)
9941  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9942  *
9943  * (<__pyx_buffer *> &self.view).obj = NULL
9944  */
9945  }
9946  __pyx_L3:;
9947 
9948  /* "View.MemoryView":382
9949  * cdef int i
9950  * global __pyx_memoryview_thread_locks_used
9951  * if self.lock != NULL: # <<<<<<<<<<<<<<
9952  * for i in range(__pyx_memoryview_thread_locks_used):
9953  * if __pyx_memoryview_thread_locks[i] is self.lock:
9954  */
9955  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
9956  if (__pyx_t_2) {
9957 
9958  /* "View.MemoryView":383
9959  * global __pyx_memoryview_thread_locks_used
9960  * if self.lock != NULL:
9961  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
9962  * if __pyx_memoryview_thread_locks[i] is self.lock:
9963  * __pyx_memoryview_thread_locks_used -= 1
9964  */
9965  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
9966  __pyx_t_4 = __pyx_t_3;
9967  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
9968  __pyx_v_i = __pyx_t_5;
9969 
9970  /* "View.MemoryView":384
9971  * if self.lock != NULL:
9972  * for i in range(__pyx_memoryview_thread_locks_used):
9973  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
9974  * __pyx_memoryview_thread_locks_used -= 1
9975  * if i != __pyx_memoryview_thread_locks_used:
9976  */
9977  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
9978  if (__pyx_t_2) {
9979 
9980  /* "View.MemoryView":385
9981  * for i in range(__pyx_memoryview_thread_locks_used):
9982  * if __pyx_memoryview_thread_locks[i] is self.lock:
9983  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
9984  * if i != __pyx_memoryview_thread_locks_used:
9985  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9986  */
9987  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
9988 
9989  /* "View.MemoryView":386
9990  * if __pyx_memoryview_thread_locks[i] is self.lock:
9991  * __pyx_memoryview_thread_locks_used -= 1
9992  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
9993  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9994  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9995  */
9996  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
9997  if (__pyx_t_2) {
9998 
9999  /* "View.MemoryView":388
10000  * if i != __pyx_memoryview_thread_locks_used:
10001  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10002  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
10003  * break
10004  * else:
10005  */
10006  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10007  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10008 
10009  /* "View.MemoryView":387
10010  * __pyx_memoryview_thread_locks_used -= 1
10011  * if i != __pyx_memoryview_thread_locks_used:
10012  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
10013  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10014  * break
10015  */
10016  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10017  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10018 
10019  /* "View.MemoryView":386
10020  * if __pyx_memoryview_thread_locks[i] is self.lock:
10021  * __pyx_memoryview_thread_locks_used -= 1
10022  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10023  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10024  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10025  */
10026  }
10027 
10028  /* "View.MemoryView":389
10029  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10030  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10031  * break # <<<<<<<<<<<<<<
10032  * else:
10033  * PyThread_free_lock(self.lock)
10034  */
10035  goto __pyx_L6_break;
10036 
10037  /* "View.MemoryView":384
10038  * if self.lock != NULL:
10039  * for i in range(__pyx_memoryview_thread_locks_used):
10040  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10041  * __pyx_memoryview_thread_locks_used -= 1
10042  * if i != __pyx_memoryview_thread_locks_used:
10043  */
10044  }
10045  }
10046  /*else*/ {
10047 
10048  /* "View.MemoryView":391
10049  * break
10050  * else:
10051  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
10052  *
10053  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10054  */
10055  PyThread_free_lock(__pyx_v_self->lock);
10056  }
10057  __pyx_L6_break:;
10058 
10059  /* "View.MemoryView":382
10060  * cdef int i
10061  * global __pyx_memoryview_thread_locks_used
10062  * if self.lock != NULL: # <<<<<<<<<<<<<<
10063  * for i in range(__pyx_memoryview_thread_locks_used):
10064  * if __pyx_memoryview_thread_locks[i] is self.lock:
10065  */
10066  }
10067 
10068  /* "View.MemoryView":372
10069  * self.typeinfo = NULL
10070  *
10071  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10072  * if self.obj is not None:
10073  * __Pyx_ReleaseBuffer(&self.view)
10074  */
10075 
10076  /* function exit code */
10077  __Pyx_RefNannyFinishContext();
10078 }
10079 
10080 /* "View.MemoryView":393
10081  * PyThread_free_lock(self.lock)
10082  *
10083  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10084  * cdef Py_ssize_t dim
10085  * cdef char *itemp = <char *> self.view.buf
10086  */
10087 
10088 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10089  Py_ssize_t __pyx_v_dim;
10090  char *__pyx_v_itemp;
10091  PyObject *__pyx_v_idx = NULL;
10092  char *__pyx_r;
10093  __Pyx_RefNannyDeclarations
10094  Py_ssize_t __pyx_t_1;
10095  PyObject *__pyx_t_2 = NULL;
10096  Py_ssize_t __pyx_t_3;
10097  PyObject *(*__pyx_t_4)(PyObject *);
10098  PyObject *__pyx_t_5 = NULL;
10099  Py_ssize_t __pyx_t_6;
10100  char *__pyx_t_7;
10101  int __pyx_lineno = 0;
10102  const char *__pyx_filename = NULL;
10103  int __pyx_clineno = 0;
10104  __Pyx_RefNannySetupContext("get_item_pointer", 0);
10105 
10106  /* "View.MemoryView":395
10107  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10108  * cdef Py_ssize_t dim
10109  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
10110  *
10111  * for dim, idx in enumerate(index):
10112  */
10113  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
10114 
10115  /* "View.MemoryView":397
10116  * cdef char *itemp = <char *> self.view.buf
10117  *
10118  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10119  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10120  *
10121  */
10122  __pyx_t_1 = 0;
10123  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10124  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10125  __pyx_t_4 = NULL;
10126  } else {
10127  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
10128  __Pyx_GOTREF(__pyx_t_2);
10129  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
10130  }
10131  for (;;) {
10132  if (likely(!__pyx_t_4)) {
10133  if (likely(PyList_CheckExact(__pyx_t_2))) {
10134  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
10135  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10136  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10137  #else
10138  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10139  __Pyx_GOTREF(__pyx_t_5);
10140  #endif
10141  } else {
10142  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
10143  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10144  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10145  #else
10146  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10147  __Pyx_GOTREF(__pyx_t_5);
10148  #endif
10149  }
10150  } else {
10151  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10152  if (unlikely(!__pyx_t_5)) {
10153  PyObject* exc_type = PyErr_Occurred();
10154  if (exc_type) {
10155  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10156  else __PYX_ERR(1, 397, __pyx_L1_error)
10157  }
10158  break;
10159  }
10160  __Pyx_GOTREF(__pyx_t_5);
10161  }
10162  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10163  __pyx_t_5 = 0;
10164  __pyx_v_dim = __pyx_t_1;
10165  __pyx_t_1 = (__pyx_t_1 + 1);
10166 
10167  /* "View.MemoryView":398
10168  *
10169  * for dim, idx in enumerate(index):
10170  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
10171  *
10172  * return itemp
10173  */
10174  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
10175  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
10176  __pyx_v_itemp = __pyx_t_7;
10177 
10178  /* "View.MemoryView":397
10179  * cdef char *itemp = <char *> self.view.buf
10180  *
10181  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10182  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10183  *
10184  */
10185  }
10186  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10187 
10188  /* "View.MemoryView":400
10189  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10190  *
10191  * return itemp # <<<<<<<<<<<<<<
10192  *
10193  *
10194  */
10195  __pyx_r = __pyx_v_itemp;
10196  goto __pyx_L0;
10197 
10198  /* "View.MemoryView":393
10199  * PyThread_free_lock(self.lock)
10200  *
10201  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10202  * cdef Py_ssize_t dim
10203  * cdef char *itemp = <char *> self.view.buf
10204  */
10205 
10206  /* function exit code */
10207  __pyx_L1_error:;
10208  __Pyx_XDECREF(__pyx_t_2);
10209  __Pyx_XDECREF(__pyx_t_5);
10210  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10211  __pyx_r = NULL;
10212  __pyx_L0:;
10213  __Pyx_XDECREF(__pyx_v_idx);
10214  __Pyx_RefNannyFinishContext();
10215  return __pyx_r;
10216 }
10217 
10218 /* "View.MemoryView":403
10219  *
10220  *
10221  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10222  * if index is Ellipsis:
10223  * return self
10224  */
10225 
10226 /* Python wrapper */
10227 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
10228 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10229  PyObject *__pyx_r = 0;
10230  __Pyx_RefNannyDeclarations
10231  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10232  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10233 
10234  /* function exit code */
10235  __Pyx_RefNannyFinishContext();
10236  return __pyx_r;
10237 }
10238 
10239 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10240  PyObject *__pyx_v_have_slices = NULL;
10241  PyObject *__pyx_v_indices = NULL;
10242  char *__pyx_v_itemp;
10243  PyObject *__pyx_r = NULL;
10244  __Pyx_RefNannyDeclarations
10245  int __pyx_t_1;
10246  int __pyx_t_2;
10247  PyObject *__pyx_t_3 = NULL;
10248  PyObject *__pyx_t_4 = NULL;
10249  PyObject *__pyx_t_5 = NULL;
10250  char *__pyx_t_6;
10251  int __pyx_lineno = 0;
10252  const char *__pyx_filename = NULL;
10253  int __pyx_clineno = 0;
10254  __Pyx_RefNannySetupContext("__getitem__", 0);
10255 
10256  /* "View.MemoryView":404
10257  *
10258  * def __getitem__(memoryview self, object index):
10259  * if index is Ellipsis: # <<<<<<<<<<<<<<
10260  * return self
10261  *
10262  */
10263  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10264  __pyx_t_2 = (__pyx_t_1 != 0);
10265  if (__pyx_t_2) {
10266 
10267  /* "View.MemoryView":405
10268  * def __getitem__(memoryview self, object index):
10269  * if index is Ellipsis:
10270  * return self # <<<<<<<<<<<<<<
10271  *
10272  * have_slices, indices = _unellipsify(index, self.view.ndim)
10273  */
10274  __Pyx_XDECREF(__pyx_r);
10275  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10276  __pyx_r = ((PyObject *)__pyx_v_self);
10277  goto __pyx_L0;
10278 
10279  /* "View.MemoryView":404
10280  *
10281  * def __getitem__(memoryview self, object index):
10282  * if index is Ellipsis: # <<<<<<<<<<<<<<
10283  * return self
10284  *
10285  */
10286  }
10287 
10288  /* "View.MemoryView":407
10289  * return self
10290  *
10291  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10292  *
10293  * cdef char *itemp
10294  */
10295  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
10296  __Pyx_GOTREF(__pyx_t_3);
10297  if (likely(__pyx_t_3 != Py_None)) {
10298  PyObject* sequence = __pyx_t_3;
10299  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10300  if (unlikely(size != 2)) {
10301  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10302  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10303  __PYX_ERR(1, 407, __pyx_L1_error)
10304  }
10305  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10306  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10307  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10308  __Pyx_INCREF(__pyx_t_4);
10309  __Pyx_INCREF(__pyx_t_5);
10310  #else
10311  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
10312  __Pyx_GOTREF(__pyx_t_4);
10313  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
10314  __Pyx_GOTREF(__pyx_t_5);
10315  #endif
10316  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10317  } else {
10318  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
10319  }
10320  __pyx_v_have_slices = __pyx_t_4;
10321  __pyx_t_4 = 0;
10322  __pyx_v_indices = __pyx_t_5;
10323  __pyx_t_5 = 0;
10324 
10325  /* "View.MemoryView":410
10326  *
10327  * cdef char *itemp
10328  * if have_slices: # <<<<<<<<<<<<<<
10329  * return memview_slice(self, indices)
10330  * else:
10331  */
10332  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
10333  if (__pyx_t_2) {
10334 
10335  /* "View.MemoryView":411
10336  * cdef char *itemp
10337  * if have_slices:
10338  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
10339  * else:
10340  * itemp = self.get_item_pointer(indices)
10341  */
10342  __Pyx_XDECREF(__pyx_r);
10343  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
10344  __Pyx_GOTREF(__pyx_t_3);
10345  __pyx_r = __pyx_t_3;
10346  __pyx_t_3 = 0;
10347  goto __pyx_L0;
10348 
10349  /* "View.MemoryView":410
10350  *
10351  * cdef char *itemp
10352  * if have_slices: # <<<<<<<<<<<<<<
10353  * return memview_slice(self, indices)
10354  * else:
10355  */
10356  }
10357 
10358  /* "View.MemoryView":413
10359  * return memview_slice(self, indices)
10360  * else:
10361  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
10362  * return self.convert_item_to_object(itemp)
10363  *
10364  */
10365  /*else*/ {
10366  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
10367  __pyx_v_itemp = __pyx_t_6;
10368 
10369  /* "View.MemoryView":414
10370  * else:
10371  * itemp = self.get_item_pointer(indices)
10372  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
10373  *
10374  * def __setitem__(memoryview self, object index, object value):
10375  */
10376  __Pyx_XDECREF(__pyx_r);
10377  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
10378  __Pyx_GOTREF(__pyx_t_3);
10379  __pyx_r = __pyx_t_3;
10380  __pyx_t_3 = 0;
10381  goto __pyx_L0;
10382  }
10383 
10384  /* "View.MemoryView":403
10385  *
10386  *
10387  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10388  * if index is Ellipsis:
10389  * return self
10390  */
10391 
10392  /* function exit code */
10393  __pyx_L1_error:;
10394  __Pyx_XDECREF(__pyx_t_3);
10395  __Pyx_XDECREF(__pyx_t_4);
10396  __Pyx_XDECREF(__pyx_t_5);
10397  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10398  __pyx_r = NULL;
10399  __pyx_L0:;
10400  __Pyx_XDECREF(__pyx_v_have_slices);
10401  __Pyx_XDECREF(__pyx_v_indices);
10402  __Pyx_XGIVEREF(__pyx_r);
10403  __Pyx_RefNannyFinishContext();
10404  return __pyx_r;
10405 }
10406 
10407 /* "View.MemoryView":416
10408  * return self.convert_item_to_object(itemp)
10409  *
10410  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10411  * if self.view.readonly:
10412  * raise TypeError("Cannot assign to read-only memoryview")
10413  */
10414 
10415 /* Python wrapper */
10416 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
10417 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10418  int __pyx_r;
10419  __Pyx_RefNannyDeclarations
10420  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10421  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
10422 
10423  /* function exit code */
10424  __Pyx_RefNannyFinishContext();
10425  return __pyx_r;
10426 }
10427 
10428 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10429  PyObject *__pyx_v_have_slices = NULL;
10430  PyObject *__pyx_v_obj = NULL;
10431  int __pyx_r;
10432  __Pyx_RefNannyDeclarations
10433  int __pyx_t_1;
10434  PyObject *__pyx_t_2 = NULL;
10435  PyObject *__pyx_t_3 = NULL;
10436  PyObject *__pyx_t_4 = NULL;
10437  int __pyx_lineno = 0;
10438  const char *__pyx_filename = NULL;
10439  int __pyx_clineno = 0;
10440  __Pyx_RefNannySetupContext("__setitem__", 0);
10441  __Pyx_INCREF(__pyx_v_index);
10442 
10443  /* "View.MemoryView":417
10444  *
10445  * def __setitem__(memoryview self, object index, object value):
10446  * if self.view.readonly: # <<<<<<<<<<<<<<
10447  * raise TypeError("Cannot assign to read-only memoryview")
10448  *
10449  */
10450  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
10451  if (unlikely(__pyx_t_1)) {
10452 
10453  /* "View.MemoryView":418
10454  * def __setitem__(memoryview self, object index, object value):
10455  * if self.view.readonly:
10456  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
10457  *
10458  * have_slices, index = _unellipsify(index, self.view.ndim)
10459  */
10460  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
10461  __Pyx_GOTREF(__pyx_t_2);
10462  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
10463  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10464  __PYX_ERR(1, 418, __pyx_L1_error)
10465 
10466  /* "View.MemoryView":417
10467  *
10468  * def __setitem__(memoryview self, object index, object value):
10469  * if self.view.readonly: # <<<<<<<<<<<<<<
10470  * raise TypeError("Cannot assign to read-only memoryview")
10471  *
10472  */
10473  }
10474 
10475  /* "View.MemoryView":420
10476  * raise TypeError("Cannot assign to read-only memoryview")
10477  *
10478  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10479  *
10480  * if have_slices:
10481  */
10482  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
10483  __Pyx_GOTREF(__pyx_t_2);
10484  if (likely(__pyx_t_2 != Py_None)) {
10485  PyObject* sequence = __pyx_t_2;
10486  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10487  if (unlikely(size != 2)) {
10488  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10489  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10490  __PYX_ERR(1, 420, __pyx_L1_error)
10491  }
10492  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10493  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
10494  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
10495  __Pyx_INCREF(__pyx_t_3);
10496  __Pyx_INCREF(__pyx_t_4);
10497  #else
10498  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
10499  __Pyx_GOTREF(__pyx_t_3);
10500  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
10501  __Pyx_GOTREF(__pyx_t_4);
10502  #endif
10503  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10504  } else {
10505  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
10506  }
10507  __pyx_v_have_slices = __pyx_t_3;
10508  __pyx_t_3 = 0;
10509  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
10510  __pyx_t_4 = 0;
10511 
10512  /* "View.MemoryView":422
10513  * have_slices, index = _unellipsify(index, self.view.ndim)
10514  *
10515  * if have_slices: # <<<<<<<<<<<<<<
10516  * obj = self.is_slice(value)
10517  * if obj:
10518  */
10519  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
10520  if (__pyx_t_1) {
10521 
10522  /* "View.MemoryView":423
10523  *
10524  * if have_slices:
10525  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
10526  * if obj:
10527  * self.setitem_slice_assignment(self[index], obj)
10528  */
10529  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
10530  __Pyx_GOTREF(__pyx_t_2);
10531  __pyx_v_obj = __pyx_t_2;
10532  __pyx_t_2 = 0;
10533 
10534  /* "View.MemoryView":424
10535  * if have_slices:
10536  * obj = self.is_slice(value)
10537  * if obj: # <<<<<<<<<<<<<<
10538  * self.setitem_slice_assignment(self[index], obj)
10539  * else:
10540  */
10541  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
10542  if (__pyx_t_1) {
10543 
10544  /* "View.MemoryView":425
10545  * obj = self.is_slice(value)
10546  * if obj:
10547  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
10548  * else:
10549  * self.setitem_slice_assign_scalar(self[index], value)
10550  */
10551  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
10552  __Pyx_GOTREF(__pyx_t_2);
10553  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
10554  __Pyx_GOTREF(__pyx_t_4);
10555  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10556  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10557 
10558  /* "View.MemoryView":424
10559  * if have_slices:
10560  * obj = self.is_slice(value)
10561  * if obj: # <<<<<<<<<<<<<<
10562  * self.setitem_slice_assignment(self[index], obj)
10563  * else:
10564  */
10565  goto __pyx_L5;
10566  }
10567 
10568  /* "View.MemoryView":427
10569  * self.setitem_slice_assignment(self[index], obj)
10570  * else:
10571  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
10572  * else:
10573  * self.setitem_indexed(index, value)
10574  */
10575  /*else*/ {
10576  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
10577  __Pyx_GOTREF(__pyx_t_4);
10578  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
10579  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
10580  __Pyx_GOTREF(__pyx_t_2);
10581  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10582  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10583  }
10584  __pyx_L5:;
10585 
10586  /* "View.MemoryView":422
10587  * have_slices, index = _unellipsify(index, self.view.ndim)
10588  *
10589  * if have_slices: # <<<<<<<<<<<<<<
10590  * obj = self.is_slice(value)
10591  * if obj:
10592  */
10593  goto __pyx_L4;
10594  }
10595 
10596  /* "View.MemoryView":429
10597  * self.setitem_slice_assign_scalar(self[index], value)
10598  * else:
10599  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
10600  *
10601  * cdef is_slice(self, obj):
10602  */
10603  /*else*/ {
10604  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
10605  __Pyx_GOTREF(__pyx_t_2);
10606  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10607  }
10608  __pyx_L4:;
10609 
10610  /* "View.MemoryView":416
10611  * return self.convert_item_to_object(itemp)
10612  *
10613  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10614  * if self.view.readonly:
10615  * raise TypeError("Cannot assign to read-only memoryview")
10616  */
10617 
10618  /* function exit code */
10619  __pyx_r = 0;
10620  goto __pyx_L0;
10621  __pyx_L1_error:;
10622  __Pyx_XDECREF(__pyx_t_2);
10623  __Pyx_XDECREF(__pyx_t_3);
10624  __Pyx_XDECREF(__pyx_t_4);
10625  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10626  __pyx_r = -1;
10627  __pyx_L0:;
10628  __Pyx_XDECREF(__pyx_v_have_slices);
10629  __Pyx_XDECREF(__pyx_v_obj);
10630  __Pyx_XDECREF(__pyx_v_index);
10631  __Pyx_RefNannyFinishContext();
10632  return __pyx_r;
10633 }
10634 
10635 /* "View.MemoryView":431
10636  * self.setitem_indexed(index, value)
10637  *
10638  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10639  * if not isinstance(obj, memoryview):
10640  * try:
10641  */
10642 
10643 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
10644  PyObject *__pyx_r = NULL;
10645  __Pyx_RefNannyDeclarations
10646  int __pyx_t_1;
10647  int __pyx_t_2;
10648  PyObject *__pyx_t_3 = NULL;
10649  PyObject *__pyx_t_4 = NULL;
10650  PyObject *__pyx_t_5 = NULL;
10651  PyObject *__pyx_t_6 = NULL;
10652  PyObject *__pyx_t_7 = NULL;
10653  PyObject *__pyx_t_8 = NULL;
10654  int __pyx_t_9;
10655  int __pyx_lineno = 0;
10656  const char *__pyx_filename = NULL;
10657  int __pyx_clineno = 0;
10658  __Pyx_RefNannySetupContext("is_slice", 0);
10659  __Pyx_INCREF(__pyx_v_obj);
10660 
10661  /* "View.MemoryView":432
10662  *
10663  * cdef is_slice(self, obj):
10664  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10665  * try:
10666  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10667  */
10668  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10669  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
10670  if (__pyx_t_2) {
10671 
10672  /* "View.MemoryView":433
10673  * cdef is_slice(self, obj):
10674  * if not isinstance(obj, memoryview):
10675  * try: # <<<<<<<<<<<<<<
10676  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10677  * self.dtype_is_object)
10678  */
10679  {
10680  __Pyx_PyThreadState_declare
10681  __Pyx_PyThreadState_assign
10682  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10683  __Pyx_XGOTREF(__pyx_t_3);
10684  __Pyx_XGOTREF(__pyx_t_4);
10685  __Pyx_XGOTREF(__pyx_t_5);
10686  /*try:*/ {
10687 
10688  /* "View.MemoryView":434
10689  * if not isinstance(obj, memoryview):
10690  * try:
10691  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10692  * self.dtype_is_object)
10693  * except TypeError:
10694  */
10695  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
10696  __Pyx_GOTREF(__pyx_t_6);
10697 
10698  /* "View.MemoryView":435
10699  * try:
10700  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10701  * self.dtype_is_object) # <<<<<<<<<<<<<<
10702  * except TypeError:
10703  * return None
10704  */
10705  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
10706  __Pyx_GOTREF(__pyx_t_7);
10707 
10708  /* "View.MemoryView":434
10709  * if not isinstance(obj, memoryview):
10710  * try:
10711  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10712  * self.dtype_is_object)
10713  * except TypeError:
10714  */
10715  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
10716  __Pyx_GOTREF(__pyx_t_8);
10717  __Pyx_INCREF(__pyx_v_obj);
10718  __Pyx_GIVEREF(__pyx_v_obj);
10719  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
10720  __Pyx_GIVEREF(__pyx_t_6);
10721  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
10722  __Pyx_GIVEREF(__pyx_t_7);
10723  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
10724  __pyx_t_6 = 0;
10725  __pyx_t_7 = 0;
10726  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
10727  __Pyx_GOTREF(__pyx_t_7);
10728  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10729  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
10730  __pyx_t_7 = 0;
10731 
10732  /* "View.MemoryView":433
10733  * cdef is_slice(self, obj):
10734  * if not isinstance(obj, memoryview):
10735  * try: # <<<<<<<<<<<<<<
10736  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10737  * self.dtype_is_object)
10738  */
10739  }
10740  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10741  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10742  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10743  goto __pyx_L9_try_end;
10744  __pyx_L4_error:;
10745  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10746  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10747  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10748 
10749  /* "View.MemoryView":436
10750  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10751  * self.dtype_is_object)
10752  * except TypeError: # <<<<<<<<<<<<<<
10753  * return None
10754  *
10755  */
10756  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10757  if (__pyx_t_9) {
10758  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10759  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
10760  __Pyx_GOTREF(__pyx_t_7);
10761  __Pyx_GOTREF(__pyx_t_8);
10762  __Pyx_GOTREF(__pyx_t_6);
10763 
10764  /* "View.MemoryView":437
10765  * self.dtype_is_object)
10766  * except TypeError:
10767  * return None # <<<<<<<<<<<<<<
10768  *
10769  * return obj
10770  */
10771  __Pyx_XDECREF(__pyx_r);
10772  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10773  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10774  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10775  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10776  goto __pyx_L7_except_return;
10777  }
10778  goto __pyx_L6_except_error;
10779  __pyx_L6_except_error:;
10780 
10781  /* "View.MemoryView":433
10782  * cdef is_slice(self, obj):
10783  * if not isinstance(obj, memoryview):
10784  * try: # <<<<<<<<<<<<<<
10785  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10786  * self.dtype_is_object)
10787  */
10788  __Pyx_XGIVEREF(__pyx_t_3);
10789  __Pyx_XGIVEREF(__pyx_t_4);
10790  __Pyx_XGIVEREF(__pyx_t_5);
10791  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10792  goto __pyx_L1_error;
10793  __pyx_L7_except_return:;
10794  __Pyx_XGIVEREF(__pyx_t_3);
10795  __Pyx_XGIVEREF(__pyx_t_4);
10796  __Pyx_XGIVEREF(__pyx_t_5);
10797  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10798  goto __pyx_L0;
10799  __pyx_L9_try_end:;
10800  }
10801 
10802  /* "View.MemoryView":432
10803  *
10804  * cdef is_slice(self, obj):
10805  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10806  * try:
10807  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10808  */
10809  }
10810 
10811  /* "View.MemoryView":439
10812  * return None
10813  *
10814  * return obj # <<<<<<<<<<<<<<
10815  *
10816  * cdef setitem_slice_assignment(self, dst, src):
10817  */
10818  __Pyx_XDECREF(__pyx_r);
10819  __Pyx_INCREF(__pyx_v_obj);
10820  __pyx_r = __pyx_v_obj;
10821  goto __pyx_L0;
10822 
10823  /* "View.MemoryView":431
10824  * self.setitem_indexed(index, value)
10825  *
10826  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10827  * if not isinstance(obj, memoryview):
10828  * try:
10829  */
10830 
10831  /* function exit code */
10832  __pyx_L1_error:;
10833  __Pyx_XDECREF(__pyx_t_6);
10834  __Pyx_XDECREF(__pyx_t_7);
10835  __Pyx_XDECREF(__pyx_t_8);
10836  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10837  __pyx_r = 0;
10838  __pyx_L0:;
10839  __Pyx_XDECREF(__pyx_v_obj);
10840  __Pyx_XGIVEREF(__pyx_r);
10841  __Pyx_RefNannyFinishContext();
10842  return __pyx_r;
10843 }
10844 
10845 /* "View.MemoryView":441
10846  * return obj
10847  *
10848  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10849  * cdef __Pyx_memviewslice dst_slice
10850  * cdef __Pyx_memviewslice src_slice
10851  */
10852 
10853 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
10854  __Pyx_memviewslice __pyx_v_dst_slice;
10855  __Pyx_memviewslice __pyx_v_src_slice;
10856  PyObject *__pyx_r = NULL;
10857  __Pyx_RefNannyDeclarations
10858  __Pyx_memviewslice *__pyx_t_1;
10859  __Pyx_memviewslice *__pyx_t_2;
10860  PyObject *__pyx_t_3 = NULL;
10861  int __pyx_t_4;
10862  int __pyx_t_5;
10863  int __pyx_t_6;
10864  int __pyx_lineno = 0;
10865  const char *__pyx_filename = NULL;
10866  int __pyx_clineno = 0;
10867  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
10868 
10869  /* "View.MemoryView":445
10870  * cdef __Pyx_memviewslice src_slice
10871  *
10872  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
10873  * get_slice_from_memview(dst, &dst_slice)[0],
10874  * src.ndim, dst.ndim, self.dtype_is_object)
10875  */
10876  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
10877  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
10878 
10879  /* "View.MemoryView":446
10880  *
10881  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10882  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
10883  * src.ndim, dst.ndim, self.dtype_is_object)
10884  *
10885  */
10886  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
10887  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
10888 
10889  /* "View.MemoryView":447
10890  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10891  * get_slice_from_memview(dst, &dst_slice)[0],
10892  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
10893  *
10894  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10895  */
10896  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
10897  __Pyx_GOTREF(__pyx_t_3);
10898  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
10899  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10900  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
10901  __Pyx_GOTREF(__pyx_t_3);
10902  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
10903  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10904 
10905  /* "View.MemoryView":445
10906  * cdef __Pyx_memviewslice src_slice
10907  *
10908  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
10909  * get_slice_from_memview(dst, &dst_slice)[0],
10910  * src.ndim, dst.ndim, self.dtype_is_object)
10911  */
10912  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
10913 
10914  /* "View.MemoryView":441
10915  * return obj
10916  *
10917  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10918  * cdef __Pyx_memviewslice dst_slice
10919  * cdef __Pyx_memviewslice src_slice
10920  */
10921 
10922  /* function exit code */
10923  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10924  goto __pyx_L0;
10925  __pyx_L1_error:;
10926  __Pyx_XDECREF(__pyx_t_3);
10927  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
10928  __pyx_r = 0;
10929  __pyx_L0:;
10930  __Pyx_XGIVEREF(__pyx_r);
10931  __Pyx_RefNannyFinishContext();
10932  return __pyx_r;
10933 }
10934 
10935 /* "View.MemoryView":449
10936  * src.ndim, dst.ndim, self.dtype_is_object)
10937  *
10938  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
10939  * cdef int array[128]
10940  * cdef void *tmp = NULL
10941  */
10942 
10943 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
10944  int __pyx_v_array[0x80];
10945  void *__pyx_v_tmp;
10946  void *__pyx_v_item;
10947  __Pyx_memviewslice *__pyx_v_dst_slice;
10948  __Pyx_memviewslice __pyx_v_tmp_slice;
10949  PyObject *__pyx_r = NULL;
10950  __Pyx_RefNannyDeclarations
10951  __Pyx_memviewslice *__pyx_t_1;
10952  int __pyx_t_2;
10953  PyObject *__pyx_t_3 = NULL;
10954  int __pyx_t_4;
10955  int __pyx_t_5;
10956  char const *__pyx_t_6;
10957  PyObject *__pyx_t_7 = NULL;
10958  PyObject *__pyx_t_8 = NULL;
10959  PyObject *__pyx_t_9 = NULL;
10960  PyObject *__pyx_t_10 = NULL;
10961  PyObject *__pyx_t_11 = NULL;
10962  PyObject *__pyx_t_12 = NULL;
10963  int __pyx_lineno = 0;
10964  const char *__pyx_filename = NULL;
10965  int __pyx_clineno = 0;
10966  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
10967 
10968  /* "View.MemoryView":451
10969  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10970  * cdef int array[128]
10971  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
10972  * cdef void *item
10973  *
10974  */
10975  __pyx_v_tmp = NULL;
10976 
10977  /* "View.MemoryView":456
10978  * cdef __Pyx_memviewslice *dst_slice
10979  * cdef __Pyx_memviewslice tmp_slice
10980  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
10981  *
10982  * if <size_t>self.view.itemsize > sizeof(array):
10983  */
10984  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
10985  __pyx_v_dst_slice = __pyx_t_1;
10986 
10987  /* "View.MemoryView":458
10988  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
10989  *
10990  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
10991  * tmp = PyMem_Malloc(self.view.itemsize)
10992  * if tmp == NULL:
10993  */
10994  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
10995  if (__pyx_t_2) {
10996 
10997  /* "View.MemoryView":459
10998  *
10999  * if <size_t>self.view.itemsize > sizeof(array):
11000  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
11001  * if tmp == NULL:
11002  * raise MemoryError
11003  */
11004  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11005 
11006  /* "View.MemoryView":460
11007  * if <size_t>self.view.itemsize > sizeof(array):
11008  * tmp = PyMem_Malloc(self.view.itemsize)
11009  * if tmp == NULL: # <<<<<<<<<<<<<<
11010  * raise MemoryError
11011  * item = tmp
11012  */
11013  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11014  if (unlikely(__pyx_t_2)) {
11015 
11016  /* "View.MemoryView":461
11017  * tmp = PyMem_Malloc(self.view.itemsize)
11018  * if tmp == NULL:
11019  * raise MemoryError # <<<<<<<<<<<<<<
11020  * item = tmp
11021  * else:
11022  */
11023  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
11024 
11025  /* "View.MemoryView":460
11026  * if <size_t>self.view.itemsize > sizeof(array):
11027  * tmp = PyMem_Malloc(self.view.itemsize)
11028  * if tmp == NULL: # <<<<<<<<<<<<<<
11029  * raise MemoryError
11030  * item = tmp
11031  */
11032  }
11033 
11034  /* "View.MemoryView":462
11035  * if tmp == NULL:
11036  * raise MemoryError
11037  * item = tmp # <<<<<<<<<<<<<<
11038  * else:
11039  * item = <void *> array
11040  */
11041  __pyx_v_item = __pyx_v_tmp;
11042 
11043  /* "View.MemoryView":458
11044  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11045  *
11046  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11047  * tmp = PyMem_Malloc(self.view.itemsize)
11048  * if tmp == NULL:
11049  */
11050  goto __pyx_L3;
11051  }
11052 
11053  /* "View.MemoryView":464
11054  * item = tmp
11055  * else:
11056  * item = <void *> array # <<<<<<<<<<<<<<
11057  *
11058  * try:
11059  */
11060  /*else*/ {
11061  __pyx_v_item = ((void *)__pyx_v_array);
11062  }
11063  __pyx_L3:;
11064 
11065  /* "View.MemoryView":466
11066  * item = <void *> array
11067  *
11068  * try: # <<<<<<<<<<<<<<
11069  * if self.dtype_is_object:
11070  * (<PyObject **> item)[0] = <PyObject *> value
11071  */
11072  /*try:*/ {
11073 
11074  /* "View.MemoryView":467
11075  *
11076  * try:
11077  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11078  * (<PyObject **> item)[0] = <PyObject *> value
11079  * else:
11080  */
11081  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11082  if (__pyx_t_2) {
11083 
11084  /* "View.MemoryView":468
11085  * try:
11086  * if self.dtype_is_object:
11087  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
11088  * else:
11089  * self.assign_item_from_object(<char *> item, value)
11090  */
11091  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11092 
11093  /* "View.MemoryView":467
11094  *
11095  * try:
11096  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11097  * (<PyObject **> item)[0] = <PyObject *> value
11098  * else:
11099  */
11100  goto __pyx_L8;
11101  }
11102 
11103  /* "View.MemoryView":470
11104  * (<PyObject **> item)[0] = <PyObject *> value
11105  * else:
11106  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
11107  *
11108  *
11109  */
11110  /*else*/ {
11111  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
11112  __Pyx_GOTREF(__pyx_t_3);
11113  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11114  }
11115  __pyx_L8:;
11116 
11117  /* "View.MemoryView":474
11118  *
11119  *
11120  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11121  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11122  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11123  */
11124  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11125  if (__pyx_t_2) {
11126 
11127  /* "View.MemoryView":475
11128  *
11129  * if self.view.suboffsets != NULL:
11130  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
11131  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11132  * item, self.dtype_is_object)
11133  */
11134  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
11135  __Pyx_GOTREF(__pyx_t_3);
11136  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11137 
11138  /* "View.MemoryView":474
11139  *
11140  *
11141  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11142  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11143  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11144  */
11145  }
11146 
11147  /* "View.MemoryView":476
11148  * if self.view.suboffsets != NULL:
11149  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11150  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
11151  * item, self.dtype_is_object)
11152  * finally:
11153  */
11154  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11155  }
11156 
11157  /* "View.MemoryView":479
11158  * item, self.dtype_is_object)
11159  * finally:
11160  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
11161  *
11162  * cdef setitem_indexed(self, index, value):
11163  */
11164  /*finally:*/ {
11165  /*normal exit:*/{
11166  PyMem_Free(__pyx_v_tmp);
11167  goto __pyx_L7;
11168  }
11169  __pyx_L6_error:;
11170  /*exception exit:*/{
11171  __Pyx_PyThreadState_declare
11172  __Pyx_PyThreadState_assign
11173  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11174  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11175  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11176  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
11177  __Pyx_XGOTREF(__pyx_t_7);
11178  __Pyx_XGOTREF(__pyx_t_8);
11179  __Pyx_XGOTREF(__pyx_t_9);
11180  __Pyx_XGOTREF(__pyx_t_10);
11181  __Pyx_XGOTREF(__pyx_t_11);
11182  __Pyx_XGOTREF(__pyx_t_12);
11183  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
11184  {
11185  PyMem_Free(__pyx_v_tmp);
11186  }
11187  if (PY_MAJOR_VERSION >= 3) {
11188  __Pyx_XGIVEREF(__pyx_t_10);
11189  __Pyx_XGIVEREF(__pyx_t_11);
11190  __Pyx_XGIVEREF(__pyx_t_12);
11191  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11192  }
11193  __Pyx_XGIVEREF(__pyx_t_7);
11194  __Pyx_XGIVEREF(__pyx_t_8);
11195  __Pyx_XGIVEREF(__pyx_t_9);
11196  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
11197  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11198  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
11199  goto __pyx_L1_error;
11200  }
11201  __pyx_L7:;
11202  }
11203 
11204  /* "View.MemoryView":449
11205  * src.ndim, dst.ndim, self.dtype_is_object)
11206  *
11207  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11208  * cdef int array[128]
11209  * cdef void *tmp = NULL
11210  */
11211 
11212  /* function exit code */
11213  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11214  goto __pyx_L0;
11215  __pyx_L1_error:;
11216  __Pyx_XDECREF(__pyx_t_3);
11217  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11218  __pyx_r = 0;
11219  __pyx_L0:;
11220  __Pyx_XGIVEREF(__pyx_r);
11221  __Pyx_RefNannyFinishContext();
11222  return __pyx_r;
11223 }
11224 
11225 /* "View.MemoryView":481
11226  * PyMem_Free(tmp)
11227  *
11228  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11229  * cdef char *itemp = self.get_item_pointer(index)
11230  * self.assign_item_from_object(itemp, value)
11231  */
11232 
11233 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11234  char *__pyx_v_itemp;
11235  PyObject *__pyx_r = NULL;
11236  __Pyx_RefNannyDeclarations
11237  char *__pyx_t_1;
11238  PyObject *__pyx_t_2 = NULL;
11239  int __pyx_lineno = 0;
11240  const char *__pyx_filename = NULL;
11241  int __pyx_clineno = 0;
11242  __Pyx_RefNannySetupContext("setitem_indexed", 0);
11243 
11244  /* "View.MemoryView":482
11245  *
11246  * cdef setitem_indexed(self, index, value):
11247  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
11248  * self.assign_item_from_object(itemp, value)
11249  *
11250  */
11251  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
11252  __pyx_v_itemp = __pyx_t_1;
11253 
11254  /* "View.MemoryView":483
11255  * cdef setitem_indexed(self, index, value):
11256  * cdef char *itemp = self.get_item_pointer(index)
11257  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
11258  *
11259  * cdef convert_item_to_object(self, char *itemp):
11260  */
11261  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
11262  __Pyx_GOTREF(__pyx_t_2);
11263  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11264 
11265  /* "View.MemoryView":481
11266  * PyMem_Free(tmp)
11267  *
11268  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11269  * cdef char *itemp = self.get_item_pointer(index)
11270  * self.assign_item_from_object(itemp, value)
11271  */
11272 
11273  /* function exit code */
11274  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11275  goto __pyx_L0;
11276  __pyx_L1_error:;
11277  __Pyx_XDECREF(__pyx_t_2);
11278  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11279  __pyx_r = 0;
11280  __pyx_L0:;
11281  __Pyx_XGIVEREF(__pyx_r);
11282  __Pyx_RefNannyFinishContext();
11283  return __pyx_r;
11284 }
11285 
11286 /* "View.MemoryView":485
11287  * self.assign_item_from_object(itemp, value)
11288  *
11289  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11290  * """Only used if instantiated manually by the user, or if Cython doesn't
11291  * know how to convert the type"""
11292  */
11293 
11294 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
11295  PyObject *__pyx_v_struct = NULL;
11296  PyObject *__pyx_v_bytesitem = 0;
11297  PyObject *__pyx_v_result = NULL;
11298  PyObject *__pyx_r = NULL;
11299  __Pyx_RefNannyDeclarations
11300  PyObject *__pyx_t_1 = NULL;
11301  PyObject *__pyx_t_2 = NULL;
11302  PyObject *__pyx_t_3 = NULL;
11303  PyObject *__pyx_t_4 = NULL;
11304  PyObject *__pyx_t_5 = NULL;
11305  PyObject *__pyx_t_6 = NULL;
11306  PyObject *__pyx_t_7 = NULL;
11307  int __pyx_t_8;
11308  PyObject *__pyx_t_9 = NULL;
11309  size_t __pyx_t_10;
11310  int __pyx_t_11;
11311  int __pyx_lineno = 0;
11312  const char *__pyx_filename = NULL;
11313  int __pyx_clineno = 0;
11314  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
11315 
11316  /* "View.MemoryView":488
11317  * """Only used if instantiated manually by the user, or if Cython doesn't
11318  * know how to convert the type"""
11319  * import struct # <<<<<<<<<<<<<<
11320  * cdef bytes bytesitem
11321  *
11322  */
11323  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
11324  __Pyx_GOTREF(__pyx_t_1);
11325  __pyx_v_struct = __pyx_t_1;
11326  __pyx_t_1 = 0;
11327 
11328  /* "View.MemoryView":491
11329  * cdef bytes bytesitem
11330  *
11331  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
11332  * try:
11333  * result = struct.unpack(self.view.format, bytesitem)
11334  */
11335  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
11336  __Pyx_GOTREF(__pyx_t_1);
11337  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11338  __pyx_t_1 = 0;
11339 
11340  /* "View.MemoryView":492
11341  *
11342  * bytesitem = itemp[:self.view.itemsize]
11343  * try: # <<<<<<<<<<<<<<
11344  * result = struct.unpack(self.view.format, bytesitem)
11345  * except struct.error:
11346  */
11347  {
11348  __Pyx_PyThreadState_declare
11349  __Pyx_PyThreadState_assign
11350  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11351  __Pyx_XGOTREF(__pyx_t_2);
11352  __Pyx_XGOTREF(__pyx_t_3);
11353  __Pyx_XGOTREF(__pyx_t_4);
11354  /*try:*/ {
11355 
11356  /* "View.MemoryView":493
11357  * bytesitem = itemp[:self.view.itemsize]
11358  * try:
11359  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
11360  * except struct.error:
11361  * raise ValueError("Unable to convert item to object")
11362  */
11363  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
11364  __Pyx_GOTREF(__pyx_t_5);
11365  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
11366  __Pyx_GOTREF(__pyx_t_6);
11367  __pyx_t_7 = NULL;
11368  __pyx_t_8 = 0;
11369  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11370  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11371  if (likely(__pyx_t_7)) {
11372  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11373  __Pyx_INCREF(__pyx_t_7);
11374  __Pyx_INCREF(function);
11375  __Pyx_DECREF_SET(__pyx_t_5, function);
11376  __pyx_t_8 = 1;
11377  }
11378  }
11379  #if CYTHON_FAST_PYCALL
11380  if (PyFunction_Check(__pyx_t_5)) {
11381  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11382  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11383  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11384  __Pyx_GOTREF(__pyx_t_1);
11385  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11386  } else
11387  #endif
11388  #if CYTHON_FAST_PYCCALL
11389  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11390  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11391  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11392  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11393  __Pyx_GOTREF(__pyx_t_1);
11394  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11395  } else
11396  #endif
11397  {
11398  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
11399  __Pyx_GOTREF(__pyx_t_9);
11400  if (__pyx_t_7) {
11401  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11402  }
11403  __Pyx_GIVEREF(__pyx_t_6);
11404  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
11405  __Pyx_INCREF(__pyx_v_bytesitem);
11406  __Pyx_GIVEREF(__pyx_v_bytesitem);
11407  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
11408  __pyx_t_6 = 0;
11409  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11410  __Pyx_GOTREF(__pyx_t_1);
11411  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11412  }
11413  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11414  __pyx_v_result = __pyx_t_1;
11415  __pyx_t_1 = 0;
11416 
11417  /* "View.MemoryView":492
11418  *
11419  * bytesitem = itemp[:self.view.itemsize]
11420  * try: # <<<<<<<<<<<<<<
11421  * result = struct.unpack(self.view.format, bytesitem)
11422  * except struct.error:
11423  */
11424  }
11425 
11426  /* "View.MemoryView":497
11427  * raise ValueError("Unable to convert item to object")
11428  * else:
11429  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
11430  * return result[0]
11431  * return result
11432  */
11433  /*else:*/ {
11434  __pyx_t_10 = strlen(__pyx_v_self->view.format);
11435  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11436  if (__pyx_t_11) {
11437 
11438  /* "View.MemoryView":498
11439  * else:
11440  * if len(self.view.format) == 1:
11441  * return result[0] # <<<<<<<<<<<<<<
11442  * return result
11443  *
11444  */
11445  __Pyx_XDECREF(__pyx_r);
11446  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
11447  __Pyx_GOTREF(__pyx_t_1);
11448  __pyx_r = __pyx_t_1;
11449  __pyx_t_1 = 0;
11450  goto __pyx_L6_except_return;
11451 
11452  /* "View.MemoryView":497
11453  * raise ValueError("Unable to convert item to object")
11454  * else:
11455  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
11456  * return result[0]
11457  * return result
11458  */
11459  }
11460 
11461  /* "View.MemoryView":499
11462  * if len(self.view.format) == 1:
11463  * return result[0]
11464  * return result # <<<<<<<<<<<<<<
11465  *
11466  * cdef assign_item_from_object(self, char *itemp, object value):
11467  */
11468  __Pyx_XDECREF(__pyx_r);
11469  __Pyx_INCREF(__pyx_v_result);
11470  __pyx_r = __pyx_v_result;
11471  goto __pyx_L6_except_return;
11472  }
11473  __pyx_L3_error:;
11474  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11475  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11476  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11477  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11478  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11479 
11480  /* "View.MemoryView":494
11481  * try:
11482  * result = struct.unpack(self.view.format, bytesitem)
11483  * except struct.error: # <<<<<<<<<<<<<<
11484  * raise ValueError("Unable to convert item to object")
11485  * else:
11486  */
11487  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
11488  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
11489  __Pyx_GOTREF(__pyx_t_6);
11490  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
11491  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11492  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
11493  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
11494  if (__pyx_t_8) {
11495  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11496  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
11497  __Pyx_GOTREF(__pyx_t_9);
11498  __Pyx_GOTREF(__pyx_t_5);
11499  __Pyx_GOTREF(__pyx_t_1);
11500 
11501  /* "View.MemoryView":495
11502  * result = struct.unpack(self.view.format, bytesitem)
11503  * except struct.error:
11504  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
11505  * else:
11506  * if len(self.view.format) == 1:
11507  */
11508  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
11509  __Pyx_GOTREF(__pyx_t_6);
11510  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
11511  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11512  __PYX_ERR(1, 495, __pyx_L5_except_error)
11513  }
11514  goto __pyx_L5_except_error;
11515  __pyx_L5_except_error:;
11516 
11517  /* "View.MemoryView":492
11518  *
11519  * bytesitem = itemp[:self.view.itemsize]
11520  * try: # <<<<<<<<<<<<<<
11521  * result = struct.unpack(self.view.format, bytesitem)
11522  * except struct.error:
11523  */
11524  __Pyx_XGIVEREF(__pyx_t_2);
11525  __Pyx_XGIVEREF(__pyx_t_3);
11526  __Pyx_XGIVEREF(__pyx_t_4);
11527  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11528  goto __pyx_L1_error;
11529  __pyx_L6_except_return:;
11530  __Pyx_XGIVEREF(__pyx_t_2);
11531  __Pyx_XGIVEREF(__pyx_t_3);
11532  __Pyx_XGIVEREF(__pyx_t_4);
11533  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11534  goto __pyx_L0;
11535  }
11536 
11537  /* "View.MemoryView":485
11538  * self.assign_item_from_object(itemp, value)
11539  *
11540  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11541  * """Only used if instantiated manually by the user, or if Cython doesn't
11542  * know how to convert the type"""
11543  */
11544 
11545  /* function exit code */
11546  __pyx_L1_error:;
11547  __Pyx_XDECREF(__pyx_t_1);
11548  __Pyx_XDECREF(__pyx_t_5);
11549  __Pyx_XDECREF(__pyx_t_6);
11550  __Pyx_XDECREF(__pyx_t_7);
11551  __Pyx_XDECREF(__pyx_t_9);
11552  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11553  __pyx_r = 0;
11554  __pyx_L0:;
11555  __Pyx_XDECREF(__pyx_v_struct);
11556  __Pyx_XDECREF(__pyx_v_bytesitem);
11557  __Pyx_XDECREF(__pyx_v_result);
11558  __Pyx_XGIVEREF(__pyx_r);
11559  __Pyx_RefNannyFinishContext();
11560  return __pyx_r;
11561 }
11562 
11563 /* "View.MemoryView":501
11564  * return result
11565  *
11566  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11567  * """Only used if instantiated manually by the user, or if Cython doesn't
11568  * know how to convert the type"""
11569  */
11570 
11571 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
11572  PyObject *__pyx_v_struct = NULL;
11573  char __pyx_v_c;
11574  PyObject *__pyx_v_bytesvalue = 0;
11575  Py_ssize_t __pyx_v_i;
11576  PyObject *__pyx_r = NULL;
11577  __Pyx_RefNannyDeclarations
11578  PyObject *__pyx_t_1 = NULL;
11579  int __pyx_t_2;
11580  int __pyx_t_3;
11581  PyObject *__pyx_t_4 = NULL;
11582  PyObject *__pyx_t_5 = NULL;
11583  PyObject *__pyx_t_6 = NULL;
11584  int __pyx_t_7;
11585  PyObject *__pyx_t_8 = NULL;
11586  Py_ssize_t __pyx_t_9;
11587  PyObject *__pyx_t_10 = NULL;
11588  char *__pyx_t_11;
11589  char *__pyx_t_12;
11590  char *__pyx_t_13;
11591  char *__pyx_t_14;
11592  int __pyx_lineno = 0;
11593  const char *__pyx_filename = NULL;
11594  int __pyx_clineno = 0;
11595  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
11596 
11597  /* "View.MemoryView":504
11598  * """Only used if instantiated manually by the user, or if Cython doesn't
11599  * know how to convert the type"""
11600  * import struct # <<<<<<<<<<<<<<
11601  * cdef char c
11602  * cdef bytes bytesvalue
11603  */
11604  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
11605  __Pyx_GOTREF(__pyx_t_1);
11606  __pyx_v_struct = __pyx_t_1;
11607  __pyx_t_1 = 0;
11608 
11609  /* "View.MemoryView":509
11610  * cdef Py_ssize_t i
11611  *
11612  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11613  * bytesvalue = struct.pack(self.view.format, *value)
11614  * else:
11615  */
11616  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11617  __pyx_t_3 = (__pyx_t_2 != 0);
11618  if (__pyx_t_3) {
11619 
11620  /* "View.MemoryView":510
11621  *
11622  * if isinstance(value, tuple):
11623  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
11624  * else:
11625  * bytesvalue = struct.pack(self.view.format, value)
11626  */
11627  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
11628  __Pyx_GOTREF(__pyx_t_1);
11629  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11630  __Pyx_GOTREF(__pyx_t_4);
11631  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
11632  __Pyx_GOTREF(__pyx_t_5);
11633  __Pyx_GIVEREF(__pyx_t_4);
11634  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11635  __pyx_t_4 = 0;
11636  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11637  __Pyx_GOTREF(__pyx_t_4);
11638  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
11639  __Pyx_GOTREF(__pyx_t_6);
11640  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11641  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11642  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11643  __Pyx_GOTREF(__pyx_t_4);
11644  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11645  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11646  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
11647  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11648  __pyx_t_4 = 0;
11649 
11650  /* "View.MemoryView":509
11651  * cdef Py_ssize_t i
11652  *
11653  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11654  * bytesvalue = struct.pack(self.view.format, *value)
11655  * else:
11656  */
11657  goto __pyx_L3;
11658  }
11659 
11660  /* "View.MemoryView":512
11661  * bytesvalue = struct.pack(self.view.format, *value)
11662  * else:
11663  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
11664  *
11665  * for i, c in enumerate(bytesvalue):
11666  */
11667  /*else*/ {
11668  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
11669  __Pyx_GOTREF(__pyx_t_6);
11670  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
11671  __Pyx_GOTREF(__pyx_t_1);
11672  __pyx_t_5 = NULL;
11673  __pyx_t_7 = 0;
11674  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
11675  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
11676  if (likely(__pyx_t_5)) {
11677  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
11678  __Pyx_INCREF(__pyx_t_5);
11679  __Pyx_INCREF(function);
11680  __Pyx_DECREF_SET(__pyx_t_6, function);
11681  __pyx_t_7 = 1;
11682  }
11683  }
11684  #if CYTHON_FAST_PYCALL
11685  if (PyFunction_Check(__pyx_t_6)) {
11686  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11687  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11688  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11689  __Pyx_GOTREF(__pyx_t_4);
11690  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11691  } else
11692  #endif
11693  #if CYTHON_FAST_PYCCALL
11694  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
11695  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11696  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11697  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11698  __Pyx_GOTREF(__pyx_t_4);
11699  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11700  } else
11701  #endif
11702  {
11703  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
11704  __Pyx_GOTREF(__pyx_t_8);
11705  if (__pyx_t_5) {
11706  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
11707  }
11708  __Pyx_GIVEREF(__pyx_t_1);
11709  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
11710  __Pyx_INCREF(__pyx_v_value);
11711  __Pyx_GIVEREF(__pyx_v_value);
11712  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
11713  __pyx_t_1 = 0;
11714  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11715  __Pyx_GOTREF(__pyx_t_4);
11716  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11717  }
11718  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11719  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
11720  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11721  __pyx_t_4 = 0;
11722  }
11723  __pyx_L3:;
11724 
11725  /* "View.MemoryView":514
11726  * bytesvalue = struct.pack(self.view.format, value)
11727  *
11728  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11729  * itemp[i] = c
11730  *
11731  */
11732  __pyx_t_9 = 0;
11733  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
11734  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
11735  __PYX_ERR(1, 514, __pyx_L1_error)
11736  }
11737  __Pyx_INCREF(__pyx_v_bytesvalue);
11738  __pyx_t_10 = __pyx_v_bytesvalue;
11739  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
11740  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
11741  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
11742  __pyx_t_11 = __pyx_t_14;
11743  __pyx_v_c = (__pyx_t_11[0]);
11744 
11745  /* "View.MemoryView":515
11746  *
11747  * for i, c in enumerate(bytesvalue):
11748  * itemp[i] = c # <<<<<<<<<<<<<<
11749  *
11750  * @cname('getbuffer')
11751  */
11752  __pyx_v_i = __pyx_t_9;
11753 
11754  /* "View.MemoryView":514
11755  * bytesvalue = struct.pack(self.view.format, value)
11756  *
11757  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11758  * itemp[i] = c
11759  *
11760  */
11761  __pyx_t_9 = (__pyx_t_9 + 1);
11762 
11763  /* "View.MemoryView":515
11764  *
11765  * for i, c in enumerate(bytesvalue):
11766  * itemp[i] = c # <<<<<<<<<<<<<<
11767  *
11768  * @cname('getbuffer')
11769  */
11770  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
11771  }
11772  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11773 
11774  /* "View.MemoryView":501
11775  * return result
11776  *
11777  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11778  * """Only used if instantiated manually by the user, or if Cython doesn't
11779  * know how to convert the type"""
11780  */
11781 
11782  /* function exit code */
11783  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11784  goto __pyx_L0;
11785  __pyx_L1_error:;
11786  __Pyx_XDECREF(__pyx_t_1);
11787  __Pyx_XDECREF(__pyx_t_4);
11788  __Pyx_XDECREF(__pyx_t_5);
11789  __Pyx_XDECREF(__pyx_t_6);
11790  __Pyx_XDECREF(__pyx_t_8);
11791  __Pyx_XDECREF(__pyx_t_10);
11792  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11793  __pyx_r = 0;
11794  __pyx_L0:;
11795  __Pyx_XDECREF(__pyx_v_struct);
11796  __Pyx_XDECREF(__pyx_v_bytesvalue);
11797  __Pyx_XGIVEREF(__pyx_r);
11798  __Pyx_RefNannyFinishContext();
11799  return __pyx_r;
11800 }
11801 
11802 /* "View.MemoryView":518
11803  *
11804  * @cname('getbuffer')
11805  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
11806  * if flags & PyBUF_WRITABLE and self.view.readonly:
11807  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11808  */
11809 
11810 /* Python wrapper */
11811 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
11812 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
11813  int __pyx_r;
11814  __Pyx_RefNannyDeclarations
11815  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
11816  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
11817 
11818  /* function exit code */
11819  __Pyx_RefNannyFinishContext();
11820  return __pyx_r;
11821 }
11822 
11823 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
11824  int __pyx_r;
11825  __Pyx_RefNannyDeclarations
11826  int __pyx_t_1;
11827  int __pyx_t_2;
11828  PyObject *__pyx_t_3 = NULL;
11829  Py_ssize_t *__pyx_t_4;
11830  char *__pyx_t_5;
11831  void *__pyx_t_6;
11832  int __pyx_t_7;
11833  Py_ssize_t __pyx_t_8;
11834  int __pyx_lineno = 0;
11835  const char *__pyx_filename = NULL;
11836  int __pyx_clineno = 0;
11837  if (__pyx_v_info == NULL) {
11838  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
11839  return -1;
11840  }
11841  __Pyx_RefNannySetupContext("__getbuffer__", 0);
11842  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11843  __Pyx_GIVEREF(__pyx_v_info->obj);
11844 
11845  /* "View.MemoryView":519
11846  * @cname('getbuffer')
11847  * def __getbuffer__(self, Py_buffer *info, int flags):
11848  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11849  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11850  *
11851  */
11852  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11853  if (__pyx_t_2) {
11854  } else {
11855  __pyx_t_1 = __pyx_t_2;
11856  goto __pyx_L4_bool_binop_done;
11857  }
11858  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
11859  __pyx_t_1 = __pyx_t_2;
11860  __pyx_L4_bool_binop_done:;
11861  if (unlikely(__pyx_t_1)) {
11862 
11863  /* "View.MemoryView":520
11864  * def __getbuffer__(self, Py_buffer *info, int flags):
11865  * if flags & PyBUF_WRITABLE and self.view.readonly:
11866  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
11867  *
11868  * if flags & PyBUF_ND:
11869  */
11870  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
11871  __Pyx_GOTREF(__pyx_t_3);
11872  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11873  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11874  __PYX_ERR(1, 520, __pyx_L1_error)
11875 
11876  /* "View.MemoryView":519
11877  * @cname('getbuffer')
11878  * def __getbuffer__(self, Py_buffer *info, int flags):
11879  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11880  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11881  *
11882  */
11883  }
11884 
11885  /* "View.MemoryView":522
11886  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11887  *
11888  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11889  * info.shape = self.view.shape
11890  * else:
11891  */
11892  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11893  if (__pyx_t_1) {
11894 
11895  /* "View.MemoryView":523
11896  *
11897  * if flags & PyBUF_ND:
11898  * info.shape = self.view.shape # <<<<<<<<<<<<<<
11899  * else:
11900  * info.shape = NULL
11901  */
11902  __pyx_t_4 = __pyx_v_self->view.shape;
11903  __pyx_v_info->shape = __pyx_t_4;
11904 
11905  /* "View.MemoryView":522
11906  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11907  *
11908  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11909  * info.shape = self.view.shape
11910  * else:
11911  */
11912  goto __pyx_L6;
11913  }
11914 
11915  /* "View.MemoryView":525
11916  * info.shape = self.view.shape
11917  * else:
11918  * info.shape = NULL # <<<<<<<<<<<<<<
11919  *
11920  * if flags & PyBUF_STRIDES:
11921  */
11922  /*else*/ {
11923  __pyx_v_info->shape = NULL;
11924  }
11925  __pyx_L6:;
11926 
11927  /* "View.MemoryView":527
11928  * info.shape = NULL
11929  *
11930  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11931  * info.strides = self.view.strides
11932  * else:
11933  */
11934  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
11935  if (__pyx_t_1) {
11936 
11937  /* "View.MemoryView":528
11938  *
11939  * if flags & PyBUF_STRIDES:
11940  * info.strides = self.view.strides # <<<<<<<<<<<<<<
11941  * else:
11942  * info.strides = NULL
11943  */
11944  __pyx_t_4 = __pyx_v_self->view.strides;
11945  __pyx_v_info->strides = __pyx_t_4;
11946 
11947  /* "View.MemoryView":527
11948  * info.shape = NULL
11949  *
11950  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11951  * info.strides = self.view.strides
11952  * else:
11953  */
11954  goto __pyx_L7;
11955  }
11956 
11957  /* "View.MemoryView":530
11958  * info.strides = self.view.strides
11959  * else:
11960  * info.strides = NULL # <<<<<<<<<<<<<<
11961  *
11962  * if flags & PyBUF_INDIRECT:
11963  */
11964  /*else*/ {
11965  __pyx_v_info->strides = NULL;
11966  }
11967  __pyx_L7:;
11968 
11969  /* "View.MemoryView":532
11970  * info.strides = NULL
11971  *
11972  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
11973  * info.suboffsets = self.view.suboffsets
11974  * else:
11975  */
11976  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
11977  if (__pyx_t_1) {
11978 
11979  /* "View.MemoryView":533
11980  *
11981  * if flags & PyBUF_INDIRECT:
11982  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
11983  * else:
11984  * info.suboffsets = NULL
11985  */
11986  __pyx_t_4 = __pyx_v_self->view.suboffsets;
11987  __pyx_v_info->suboffsets = __pyx_t_4;
11988 
11989  /* "View.MemoryView":532
11990  * info.strides = NULL
11991  *
11992  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
11993  * info.suboffsets = self.view.suboffsets
11994  * else:
11995  */
11996  goto __pyx_L8;
11997  }
11998 
11999  /* "View.MemoryView":535
12000  * info.suboffsets = self.view.suboffsets
12001  * else:
12002  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12003  *
12004  * if flags & PyBUF_FORMAT:
12005  */
12006  /*else*/ {
12007  __pyx_v_info->suboffsets = NULL;
12008  }
12009  __pyx_L8:;
12010 
12011  /* "View.MemoryView":537
12012  * info.suboffsets = NULL
12013  *
12014  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12015  * info.format = self.view.format
12016  * else:
12017  */
12018  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12019  if (__pyx_t_1) {
12020 
12021  /* "View.MemoryView":538
12022  *
12023  * if flags & PyBUF_FORMAT:
12024  * info.format = self.view.format # <<<<<<<<<<<<<<
12025  * else:
12026  * info.format = NULL
12027  */
12028  __pyx_t_5 = __pyx_v_self->view.format;
12029  __pyx_v_info->format = __pyx_t_5;
12030 
12031  /* "View.MemoryView":537
12032  * info.suboffsets = NULL
12033  *
12034  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12035  * info.format = self.view.format
12036  * else:
12037  */
12038  goto __pyx_L9;
12039  }
12040 
12041  /* "View.MemoryView":540
12042  * info.format = self.view.format
12043  * else:
12044  * info.format = NULL # <<<<<<<<<<<<<<
12045  *
12046  * info.buf = self.view.buf
12047  */
12048  /*else*/ {
12049  __pyx_v_info->format = NULL;
12050  }
12051  __pyx_L9:;
12052 
12053  /* "View.MemoryView":542
12054  * info.format = NULL
12055  *
12056  * info.buf = self.view.buf # <<<<<<<<<<<<<<
12057  * info.ndim = self.view.ndim
12058  * info.itemsize = self.view.itemsize
12059  */
12060  __pyx_t_6 = __pyx_v_self->view.buf;
12061  __pyx_v_info->buf = __pyx_t_6;
12062 
12063  /* "View.MemoryView":543
12064  *
12065  * info.buf = self.view.buf
12066  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
12067  * info.itemsize = self.view.itemsize
12068  * info.len = self.view.len
12069  */
12070  __pyx_t_7 = __pyx_v_self->view.ndim;
12071  __pyx_v_info->ndim = __pyx_t_7;
12072 
12073  /* "View.MemoryView":544
12074  * info.buf = self.view.buf
12075  * info.ndim = self.view.ndim
12076  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
12077  * info.len = self.view.len
12078  * info.readonly = self.view.readonly
12079  */
12080  __pyx_t_8 = __pyx_v_self->view.itemsize;
12081  __pyx_v_info->itemsize = __pyx_t_8;
12082 
12083  /* "View.MemoryView":545
12084  * info.ndim = self.view.ndim
12085  * info.itemsize = self.view.itemsize
12086  * info.len = self.view.len # <<<<<<<<<<<<<<
12087  * info.readonly = self.view.readonly
12088  * info.obj = self
12089  */
12090  __pyx_t_8 = __pyx_v_self->view.len;
12091  __pyx_v_info->len = __pyx_t_8;
12092 
12093  /* "View.MemoryView":546
12094  * info.itemsize = self.view.itemsize
12095  * info.len = self.view.len
12096  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
12097  * info.obj = self
12098  *
12099  */
12100  __pyx_t_1 = __pyx_v_self->view.readonly;
12101  __pyx_v_info->readonly = __pyx_t_1;
12102 
12103  /* "View.MemoryView":547
12104  * info.len = self.view.len
12105  * info.readonly = self.view.readonly
12106  * info.obj = self # <<<<<<<<<<<<<<
12107  *
12108  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
12109  */
12110  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12111  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12112  __Pyx_GOTREF(__pyx_v_info->obj);
12113  __Pyx_DECREF(__pyx_v_info->obj);
12114  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12115 
12116  /* "View.MemoryView":518
12117  *
12118  * @cname('getbuffer')
12119  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12120  * if flags & PyBUF_WRITABLE and self.view.readonly:
12121  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12122  */
12123 
12124  /* function exit code */
12125  __pyx_r = 0;
12126  goto __pyx_L0;
12127  __pyx_L1_error:;
12128  __Pyx_XDECREF(__pyx_t_3);
12129  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12130  __pyx_r = -1;
12131  if (__pyx_v_info->obj != NULL) {
12132  __Pyx_GOTREF(__pyx_v_info->obj);
12133  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12134  }
12135  goto __pyx_L2;
12136  __pyx_L0:;
12137  if (__pyx_v_info->obj == Py_None) {
12138  __Pyx_GOTREF(__pyx_v_info->obj);
12139  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12140  }
12141  __pyx_L2:;
12142  __Pyx_RefNannyFinishContext();
12143  return __pyx_r;
12144 }
12145 
12146 /* "View.MemoryView":553
12147  *
12148  * @property
12149  * def T(self): # <<<<<<<<<<<<<<
12150  * cdef _memoryviewslice result = memoryview_copy(self)
12151  * transpose_memslice(&result.from_slice)
12152  */
12153 
12154 /* Python wrapper */
12155 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
12156 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12157  PyObject *__pyx_r = 0;
12158  __Pyx_RefNannyDeclarations
12159  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12160  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12161 
12162  /* function exit code */
12163  __Pyx_RefNannyFinishContext();
12164  return __pyx_r;
12165 }
12166 
12167 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12168  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12169  PyObject *__pyx_r = NULL;
12170  __Pyx_RefNannyDeclarations
12171  PyObject *__pyx_t_1 = NULL;
12172  int __pyx_t_2;
12173  int __pyx_lineno = 0;
12174  const char *__pyx_filename = NULL;
12175  int __pyx_clineno = 0;
12176  __Pyx_RefNannySetupContext("__get__", 0);
12177 
12178  /* "View.MemoryView":554
12179  * @property
12180  * def T(self):
12181  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
12182  * transpose_memslice(&result.from_slice)
12183  * return result
12184  */
12185  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
12186  __Pyx_GOTREF(__pyx_t_1);
12187  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
12188  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12189  __pyx_t_1 = 0;
12190 
12191  /* "View.MemoryView":555
12192  * def T(self):
12193  * cdef _memoryviewslice result = memoryview_copy(self)
12194  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
12195  * return result
12196  *
12197  */
12198  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
12199 
12200  /* "View.MemoryView":556
12201  * cdef _memoryviewslice result = memoryview_copy(self)
12202  * transpose_memslice(&result.from_slice)
12203  * return result # <<<<<<<<<<<<<<
12204  *
12205  * @property
12206  */
12207  __Pyx_XDECREF(__pyx_r);
12208  __Pyx_INCREF(((PyObject *)__pyx_v_result));
12209  __pyx_r = ((PyObject *)__pyx_v_result);
12210  goto __pyx_L0;
12211 
12212  /* "View.MemoryView":553
12213  *
12214  * @property
12215  * def T(self): # <<<<<<<<<<<<<<
12216  * cdef _memoryviewslice result = memoryview_copy(self)
12217  * transpose_memslice(&result.from_slice)
12218  */
12219 
12220  /* function exit code */
12221  __pyx_L1_error:;
12222  __Pyx_XDECREF(__pyx_t_1);
12223  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12224  __pyx_r = NULL;
12225  __pyx_L0:;
12226  __Pyx_XDECREF((PyObject *)__pyx_v_result);
12227  __Pyx_XGIVEREF(__pyx_r);
12228  __Pyx_RefNannyFinishContext();
12229  return __pyx_r;
12230 }
12231 
12232 /* "View.MemoryView":559
12233  *
12234  * @property
12235  * def base(self): # <<<<<<<<<<<<<<
12236  * return self.obj
12237  *
12238  */
12239 
12240 /* Python wrapper */
12241 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
12242 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12243  PyObject *__pyx_r = 0;
12244  __Pyx_RefNannyDeclarations
12245  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12246  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12247 
12248  /* function exit code */
12249  __Pyx_RefNannyFinishContext();
12250  return __pyx_r;
12251 }
12252 
12253 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12254  PyObject *__pyx_r = NULL;
12255  __Pyx_RefNannyDeclarations
12256  __Pyx_RefNannySetupContext("__get__", 0);
12257 
12258  /* "View.MemoryView":560
12259  * @property
12260  * def base(self):
12261  * return self.obj # <<<<<<<<<<<<<<
12262  *
12263  * @property
12264  */
12265  __Pyx_XDECREF(__pyx_r);
12266  __Pyx_INCREF(__pyx_v_self->obj);
12267  __pyx_r = __pyx_v_self->obj;
12268  goto __pyx_L0;
12269 
12270  /* "View.MemoryView":559
12271  *
12272  * @property
12273  * def base(self): # <<<<<<<<<<<<<<
12274  * return self.obj
12275  *
12276  */
12277 
12278  /* function exit code */
12279  __pyx_L0:;
12280  __Pyx_XGIVEREF(__pyx_r);
12281  __Pyx_RefNannyFinishContext();
12282  return __pyx_r;
12283 }
12284 
12285 /* "View.MemoryView":563
12286  *
12287  * @property
12288  * def shape(self): # <<<<<<<<<<<<<<
12289  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12290  *
12291  */
12292 
12293 /* Python wrapper */
12294 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
12295 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12296  PyObject *__pyx_r = 0;
12297  __Pyx_RefNannyDeclarations
12298  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12299  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12300 
12301  /* function exit code */
12302  __Pyx_RefNannyFinishContext();
12303  return __pyx_r;
12304 }
12305 
12306 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12307  Py_ssize_t __pyx_v_length;
12308  PyObject *__pyx_r = NULL;
12309  __Pyx_RefNannyDeclarations
12310  PyObject *__pyx_t_1 = NULL;
12311  Py_ssize_t *__pyx_t_2;
12312  Py_ssize_t *__pyx_t_3;
12313  Py_ssize_t *__pyx_t_4;
12314  PyObject *__pyx_t_5 = NULL;
12315  int __pyx_lineno = 0;
12316  const char *__pyx_filename = NULL;
12317  int __pyx_clineno = 0;
12318  __Pyx_RefNannySetupContext("__get__", 0);
12319 
12320  /* "View.MemoryView":564
12321  * @property
12322  * def shape(self):
12323  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
12324  *
12325  * @property
12326  */
12327  __Pyx_XDECREF(__pyx_r);
12328  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
12329  __Pyx_GOTREF(__pyx_t_1);
12330  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12331  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12332  __pyx_t_2 = __pyx_t_4;
12333  __pyx_v_length = (__pyx_t_2[0]);
12334  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
12335  __Pyx_GOTREF(__pyx_t_5);
12336  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
12337  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12338  }
12339  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
12340  __Pyx_GOTREF(__pyx_t_5);
12341  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12342  __pyx_r = __pyx_t_5;
12343  __pyx_t_5 = 0;
12344  goto __pyx_L0;
12345 
12346  /* "View.MemoryView":563
12347  *
12348  * @property
12349  * def shape(self): # <<<<<<<<<<<<<<
12350  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12351  *
12352  */
12353 
12354  /* function exit code */
12355  __pyx_L1_error:;
12356  __Pyx_XDECREF(__pyx_t_1);
12357  __Pyx_XDECREF(__pyx_t_5);
12358  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12359  __pyx_r = NULL;
12360  __pyx_L0:;
12361  __Pyx_XGIVEREF(__pyx_r);
12362  __Pyx_RefNannyFinishContext();
12363  return __pyx_r;
12364 }
12365 
12366 /* "View.MemoryView":567
12367  *
12368  * @property
12369  * def strides(self): # <<<<<<<<<<<<<<
12370  * if self.view.strides == NULL:
12371  *
12372  */
12373 
12374 /* Python wrapper */
12375 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
12376 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
12377  PyObject *__pyx_r = 0;
12378  __Pyx_RefNannyDeclarations
12379  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12380  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12381 
12382  /* function exit code */
12383  __Pyx_RefNannyFinishContext();
12384  return __pyx_r;
12385 }
12386 
12387 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12388  Py_ssize_t __pyx_v_stride;
12389  PyObject *__pyx_r = NULL;
12390  __Pyx_RefNannyDeclarations
12391  int __pyx_t_1;
12392  PyObject *__pyx_t_2 = NULL;
12393  Py_ssize_t *__pyx_t_3;
12394  Py_ssize_t *__pyx_t_4;
12395  Py_ssize_t *__pyx_t_5;
12396  PyObject *__pyx_t_6 = NULL;
12397  int __pyx_lineno = 0;
12398  const char *__pyx_filename = NULL;
12399  int __pyx_clineno = 0;
12400  __Pyx_RefNannySetupContext("__get__", 0);
12401 
12402  /* "View.MemoryView":568
12403  * @property
12404  * def strides(self):
12405  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
12406  *
12407  * raise ValueError("Buffer view does not expose strides")
12408  */
12409  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12410  if (unlikely(__pyx_t_1)) {
12411 
12412  /* "View.MemoryView":570
12413  * if self.view.strides == NULL:
12414  *
12415  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
12416  *
12417  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
12418  */
12419  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
12420  __Pyx_GOTREF(__pyx_t_2);
12421  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12422  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12423  __PYX_ERR(1, 570, __pyx_L1_error)
12424 
12425  /* "View.MemoryView":568
12426  * @property
12427  * def strides(self):
12428  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
12429  *
12430  * raise ValueError("Buffer view does not expose strides")
12431  */
12432  }
12433 
12434  /* "View.MemoryView":572
12435  * raise ValueError("Buffer view does not expose strides")
12436  *
12437  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
12438  *
12439  * @property
12440  */
12441  __Pyx_XDECREF(__pyx_r);
12442  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
12443  __Pyx_GOTREF(__pyx_t_2);
12444  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
12445  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12446  __pyx_t_3 = __pyx_t_5;
12447  __pyx_v_stride = (__pyx_t_3[0]);
12448  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
12449  __Pyx_GOTREF(__pyx_t_6);
12450  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
12451  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12452  }
12453  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
12454  __Pyx_GOTREF(__pyx_t_6);
12455  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12456  __pyx_r = __pyx_t_6;
12457  __pyx_t_6 = 0;
12458  goto __pyx_L0;
12459 
12460  /* "View.MemoryView":567
12461  *
12462  * @property
12463  * def strides(self): # <<<<<<<<<<<<<<
12464  * if self.view.strides == NULL:
12465  *
12466  */
12467 
12468  /* function exit code */
12469  __pyx_L1_error:;
12470  __Pyx_XDECREF(__pyx_t_2);
12471  __Pyx_XDECREF(__pyx_t_6);
12472  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12473  __pyx_r = NULL;
12474  __pyx_L0:;
12475  __Pyx_XGIVEREF(__pyx_r);
12476  __Pyx_RefNannyFinishContext();
12477  return __pyx_r;
12478 }
12479 
12480 /* "View.MemoryView":575
12481  *
12482  * @property
12483  * def suboffsets(self): # <<<<<<<<<<<<<<
12484  * if self.view.suboffsets == NULL:
12485  * return (-1,) * self.view.ndim
12486  */
12487 
12488 /* Python wrapper */
12489 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
12490 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
12491  PyObject *__pyx_r = 0;
12492  __Pyx_RefNannyDeclarations
12493  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12494  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12495 
12496  /* function exit code */
12497  __Pyx_RefNannyFinishContext();
12498  return __pyx_r;
12499 }
12500 
12501 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12502  Py_ssize_t __pyx_v_suboffset;
12503  PyObject *__pyx_r = NULL;
12504  __Pyx_RefNannyDeclarations
12505  int __pyx_t_1;
12506  PyObject *__pyx_t_2 = NULL;
12507  PyObject *__pyx_t_3 = NULL;
12508  Py_ssize_t *__pyx_t_4;
12509  Py_ssize_t *__pyx_t_5;
12510  Py_ssize_t *__pyx_t_6;
12511  int __pyx_lineno = 0;
12512  const char *__pyx_filename = NULL;
12513  int __pyx_clineno = 0;
12514  __Pyx_RefNannySetupContext("__get__", 0);
12515 
12516  /* "View.MemoryView":576
12517  * @property
12518  * def suboffsets(self):
12519  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12520  * return (-1,) * self.view.ndim
12521  *
12522  */
12523  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
12524  if (__pyx_t_1) {
12525 
12526  /* "View.MemoryView":577
12527  * def suboffsets(self):
12528  * if self.view.suboffsets == NULL:
12529  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
12530  *
12531  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
12532  */
12533  __Pyx_XDECREF(__pyx_r);
12534  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
12535  __Pyx_GOTREF(__pyx_t_2);
12536  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
12537  __Pyx_GOTREF(__pyx_t_3);
12538  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12539  __pyx_r = __pyx_t_3;
12540  __pyx_t_3 = 0;
12541  goto __pyx_L0;
12542 
12543  /* "View.MemoryView":576
12544  * @property
12545  * def suboffsets(self):
12546  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12547  * return (-1,) * self.view.ndim
12548  *
12549  */
12550  }
12551 
12552  /* "View.MemoryView":579
12553  * return (-1,) * self.view.ndim
12554  *
12555  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
12556  *
12557  * @property
12558  */
12559  __Pyx_XDECREF(__pyx_r);
12560  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
12561  __Pyx_GOTREF(__pyx_t_3);
12562  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
12563  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
12564  __pyx_t_4 = __pyx_t_6;
12565  __pyx_v_suboffset = (__pyx_t_4[0]);
12566  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12567  __Pyx_GOTREF(__pyx_t_2);
12568  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
12569  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12570  }
12571  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12572  __Pyx_GOTREF(__pyx_t_2);
12573  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12574  __pyx_r = __pyx_t_2;
12575  __pyx_t_2 = 0;
12576  goto __pyx_L0;
12577 
12578  /* "View.MemoryView":575
12579  *
12580  * @property
12581  * def suboffsets(self): # <<<<<<<<<<<<<<
12582  * if self.view.suboffsets == NULL:
12583  * return (-1,) * self.view.ndim
12584  */
12585 
12586  /* function exit code */
12587  __pyx_L1_error:;
12588  __Pyx_XDECREF(__pyx_t_2);
12589  __Pyx_XDECREF(__pyx_t_3);
12590  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12591  __pyx_r = NULL;
12592  __pyx_L0:;
12593  __Pyx_XGIVEREF(__pyx_r);
12594  __Pyx_RefNannyFinishContext();
12595  return __pyx_r;
12596 }
12597 
12598 /* "View.MemoryView":582
12599  *
12600  * @property
12601  * def ndim(self): # <<<<<<<<<<<<<<
12602  * return self.view.ndim
12603  *
12604  */
12605 
12606 /* Python wrapper */
12607 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
12608 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
12609  PyObject *__pyx_r = 0;
12610  __Pyx_RefNannyDeclarations
12611  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12612  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12613 
12614  /* function exit code */
12615  __Pyx_RefNannyFinishContext();
12616  return __pyx_r;
12617 }
12618 
12619 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12620  PyObject *__pyx_r = NULL;
12621  __Pyx_RefNannyDeclarations
12622  PyObject *__pyx_t_1 = NULL;
12623  int __pyx_lineno = 0;
12624  const char *__pyx_filename = NULL;
12625  int __pyx_clineno = 0;
12626  __Pyx_RefNannySetupContext("__get__", 0);
12627 
12628  /* "View.MemoryView":583
12629  * @property
12630  * def ndim(self):
12631  * return self.view.ndim # <<<<<<<<<<<<<<
12632  *
12633  * @property
12634  */
12635  __Pyx_XDECREF(__pyx_r);
12636  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
12637  __Pyx_GOTREF(__pyx_t_1);
12638  __pyx_r = __pyx_t_1;
12639  __pyx_t_1 = 0;
12640  goto __pyx_L0;
12641 
12642  /* "View.MemoryView":582
12643  *
12644  * @property
12645  * def ndim(self): # <<<<<<<<<<<<<<
12646  * return self.view.ndim
12647  *
12648  */
12649 
12650  /* function exit code */
12651  __pyx_L1_error:;
12652  __Pyx_XDECREF(__pyx_t_1);
12653  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12654  __pyx_r = NULL;
12655  __pyx_L0:;
12656  __Pyx_XGIVEREF(__pyx_r);
12657  __Pyx_RefNannyFinishContext();
12658  return __pyx_r;
12659 }
12660 
12661 /* "View.MemoryView":586
12662  *
12663  * @property
12664  * def itemsize(self): # <<<<<<<<<<<<<<
12665  * return self.view.itemsize
12666  *
12667  */
12668 
12669 /* Python wrapper */
12670 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
12671 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
12672  PyObject *__pyx_r = 0;
12673  __Pyx_RefNannyDeclarations
12674  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12675  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12676 
12677  /* function exit code */
12678  __Pyx_RefNannyFinishContext();
12679  return __pyx_r;
12680 }
12681 
12682 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12683  PyObject *__pyx_r = NULL;
12684  __Pyx_RefNannyDeclarations
12685  PyObject *__pyx_t_1 = NULL;
12686  int __pyx_lineno = 0;
12687  const char *__pyx_filename = NULL;
12688  int __pyx_clineno = 0;
12689  __Pyx_RefNannySetupContext("__get__", 0);
12690 
12691  /* "View.MemoryView":587
12692  * @property
12693  * def itemsize(self):
12694  * return self.view.itemsize # <<<<<<<<<<<<<<
12695  *
12696  * @property
12697  */
12698  __Pyx_XDECREF(__pyx_r);
12699  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
12700  __Pyx_GOTREF(__pyx_t_1);
12701  __pyx_r = __pyx_t_1;
12702  __pyx_t_1 = 0;
12703  goto __pyx_L0;
12704 
12705  /* "View.MemoryView":586
12706  *
12707  * @property
12708  * def itemsize(self): # <<<<<<<<<<<<<<
12709  * return self.view.itemsize
12710  *
12711  */
12712 
12713  /* function exit code */
12714  __pyx_L1_error:;
12715  __Pyx_XDECREF(__pyx_t_1);
12716  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12717  __pyx_r = NULL;
12718  __pyx_L0:;
12719  __Pyx_XGIVEREF(__pyx_r);
12720  __Pyx_RefNannyFinishContext();
12721  return __pyx_r;
12722 }
12723 
12724 /* "View.MemoryView":590
12725  *
12726  * @property
12727  * def nbytes(self): # <<<<<<<<<<<<<<
12728  * return self.size * self.view.itemsize
12729  *
12730  */
12731 
12732 /* Python wrapper */
12733 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
12734 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
12735  PyObject *__pyx_r = 0;
12736  __Pyx_RefNannyDeclarations
12737  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12738  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12739 
12740  /* function exit code */
12741  __Pyx_RefNannyFinishContext();
12742  return __pyx_r;
12743 }
12744 
12745 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12746  PyObject *__pyx_r = NULL;
12747  __Pyx_RefNannyDeclarations
12748  PyObject *__pyx_t_1 = NULL;
12749  PyObject *__pyx_t_2 = NULL;
12750  PyObject *__pyx_t_3 = NULL;
12751  int __pyx_lineno = 0;
12752  const char *__pyx_filename = NULL;
12753  int __pyx_clineno = 0;
12754  __Pyx_RefNannySetupContext("__get__", 0);
12755 
12756  /* "View.MemoryView":591
12757  * @property
12758  * def nbytes(self):
12759  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
12760  *
12761  * @property
12762  */
12763  __Pyx_XDECREF(__pyx_r);
12764  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
12765  __Pyx_GOTREF(__pyx_t_1);
12766  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
12767  __Pyx_GOTREF(__pyx_t_2);
12768  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
12769  __Pyx_GOTREF(__pyx_t_3);
12770  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12771  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12772  __pyx_r = __pyx_t_3;
12773  __pyx_t_3 = 0;
12774  goto __pyx_L0;
12775 
12776  /* "View.MemoryView":590
12777  *
12778  * @property
12779  * def nbytes(self): # <<<<<<<<<<<<<<
12780  * return self.size * self.view.itemsize
12781  *
12782  */
12783 
12784  /* function exit code */
12785  __pyx_L1_error:;
12786  __Pyx_XDECREF(__pyx_t_1);
12787  __Pyx_XDECREF(__pyx_t_2);
12788  __Pyx_XDECREF(__pyx_t_3);
12789  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12790  __pyx_r = NULL;
12791  __pyx_L0:;
12792  __Pyx_XGIVEREF(__pyx_r);
12793  __Pyx_RefNannyFinishContext();
12794  return __pyx_r;
12795 }
12796 
12797 /* "View.MemoryView":594
12798  *
12799  * @property
12800  * def size(self): # <<<<<<<<<<<<<<
12801  * if self._size is None:
12802  * result = 1
12803  */
12804 
12805 /* Python wrapper */
12806 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
12807 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
12808  PyObject *__pyx_r = 0;
12809  __Pyx_RefNannyDeclarations
12810  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12811  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12812 
12813  /* function exit code */
12814  __Pyx_RefNannyFinishContext();
12815  return __pyx_r;
12816 }
12817 
12818 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12819  PyObject *__pyx_v_result = NULL;
12820  PyObject *__pyx_v_length = NULL;
12821  PyObject *__pyx_r = NULL;
12822  __Pyx_RefNannyDeclarations
12823  int __pyx_t_1;
12824  int __pyx_t_2;
12825  Py_ssize_t *__pyx_t_3;
12826  Py_ssize_t *__pyx_t_4;
12827  Py_ssize_t *__pyx_t_5;
12828  PyObject *__pyx_t_6 = NULL;
12829  int __pyx_lineno = 0;
12830  const char *__pyx_filename = NULL;
12831  int __pyx_clineno = 0;
12832  __Pyx_RefNannySetupContext("__get__", 0);
12833 
12834  /* "View.MemoryView":595
12835  * @property
12836  * def size(self):
12837  * if self._size is None: # <<<<<<<<<<<<<<
12838  * result = 1
12839  *
12840  */
12841  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12842  __pyx_t_2 = (__pyx_t_1 != 0);
12843  if (__pyx_t_2) {
12844 
12845  /* "View.MemoryView":596
12846  * def size(self):
12847  * if self._size is None:
12848  * result = 1 # <<<<<<<<<<<<<<
12849  *
12850  * for length in self.view.shape[:self.view.ndim]:
12851  */
12852  __Pyx_INCREF(__pyx_int_1);
12853  __pyx_v_result = __pyx_int_1;
12854 
12855  /* "View.MemoryView":598
12856  * result = 1
12857  *
12858  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
12859  * result *= length
12860  *
12861  */
12862  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12863  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12864  __pyx_t_3 = __pyx_t_5;
12865  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
12866  __Pyx_GOTREF(__pyx_t_6);
12867  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
12868  __pyx_t_6 = 0;
12869 
12870  /* "View.MemoryView":599
12871  *
12872  * for length in self.view.shape[:self.view.ndim]:
12873  * result *= length # <<<<<<<<<<<<<<
12874  *
12875  * self._size = result
12876  */
12877  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
12878  __Pyx_GOTREF(__pyx_t_6);
12879  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
12880  __pyx_t_6 = 0;
12881  }
12882 
12883  /* "View.MemoryView":601
12884  * result *= length
12885  *
12886  * self._size = result # <<<<<<<<<<<<<<
12887  *
12888  * return self._size
12889  */
12890  __Pyx_INCREF(__pyx_v_result);
12891  __Pyx_GIVEREF(__pyx_v_result);
12892  __Pyx_GOTREF(__pyx_v_self->_size);
12893  __Pyx_DECREF(__pyx_v_self->_size);
12894  __pyx_v_self->_size = __pyx_v_result;
12895 
12896  /* "View.MemoryView":595
12897  * @property
12898  * def size(self):
12899  * if self._size is None: # <<<<<<<<<<<<<<
12900  * result = 1
12901  *
12902  */
12903  }
12904 
12905  /* "View.MemoryView":603
12906  * self._size = result
12907  *
12908  * return self._size # <<<<<<<<<<<<<<
12909  *
12910  * def __len__(self):
12911  */
12912  __Pyx_XDECREF(__pyx_r);
12913  __Pyx_INCREF(__pyx_v_self->_size);
12914  __pyx_r = __pyx_v_self->_size;
12915  goto __pyx_L0;
12916 
12917  /* "View.MemoryView":594
12918  *
12919  * @property
12920  * def size(self): # <<<<<<<<<<<<<<
12921  * if self._size is None:
12922  * result = 1
12923  */
12924 
12925  /* function exit code */
12926  __pyx_L1_error:;
12927  __Pyx_XDECREF(__pyx_t_6);
12928  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12929  __pyx_r = NULL;
12930  __pyx_L0:;
12931  __Pyx_XDECREF(__pyx_v_result);
12932  __Pyx_XDECREF(__pyx_v_length);
12933  __Pyx_XGIVEREF(__pyx_r);
12934  __Pyx_RefNannyFinishContext();
12935  return __pyx_r;
12936 }
12937 
12938 /* "View.MemoryView":605
12939  * return self._size
12940  *
12941  * def __len__(self): # <<<<<<<<<<<<<<
12942  * if self.view.ndim >= 1:
12943  * return self.view.shape[0]
12944  */
12945 
12946 /* Python wrapper */
12947 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
12948 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
12949  Py_ssize_t __pyx_r;
12950  __Pyx_RefNannyDeclarations
12951  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
12952  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12953 
12954  /* function exit code */
12955  __Pyx_RefNannyFinishContext();
12956  return __pyx_r;
12957 }
12958 
12959 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
12960  Py_ssize_t __pyx_r;
12961  __Pyx_RefNannyDeclarations
12962  int __pyx_t_1;
12963  __Pyx_RefNannySetupContext("__len__", 0);
12964 
12965  /* "View.MemoryView":606
12966  *
12967  * def __len__(self):
12968  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
12969  * return self.view.shape[0]
12970  *
12971  */
12972  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
12973  if (__pyx_t_1) {
12974 
12975  /* "View.MemoryView":607
12976  * def __len__(self):
12977  * if self.view.ndim >= 1:
12978  * return self.view.shape[0] # <<<<<<<<<<<<<<
12979  *
12980  * return 0
12981  */
12982  __pyx_r = (__pyx_v_self->view.shape[0]);
12983  goto __pyx_L0;
12984 
12985  /* "View.MemoryView":606
12986  *
12987  * def __len__(self):
12988  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
12989  * return self.view.shape[0]
12990  *
12991  */
12992  }
12993 
12994  /* "View.MemoryView":609
12995  * return self.view.shape[0]
12996  *
12997  * return 0 # <<<<<<<<<<<<<<
12998  *
12999  * def __repr__(self):
13000  */
13001  __pyx_r = 0;
13002  goto __pyx_L0;
13003 
13004  /* "View.MemoryView":605
13005  * return self._size
13006  *
13007  * def __len__(self): # <<<<<<<<<<<<<<
13008  * if self.view.ndim >= 1:
13009  * return self.view.shape[0]
13010  */
13011 
13012  /* function exit code */
13013  __pyx_L0:;
13014  __Pyx_RefNannyFinishContext();
13015  return __pyx_r;
13016 }
13017 
13018 /* "View.MemoryView":611
13019  * return 0
13020  *
13021  * def __repr__(self): # <<<<<<<<<<<<<<
13022  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13023  * id(self))
13024  */
13025 
13026 /* Python wrapper */
13027 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
13028 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13029  PyObject *__pyx_r = 0;
13030  __Pyx_RefNannyDeclarations
13031  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13032  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13033 
13034  /* function exit code */
13035  __Pyx_RefNannyFinishContext();
13036  return __pyx_r;
13037 }
13038 
13039 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
13040  PyObject *__pyx_r = NULL;
13041  __Pyx_RefNannyDeclarations
13042  PyObject *__pyx_t_1 = NULL;
13043  PyObject *__pyx_t_2 = NULL;
13044  PyObject *__pyx_t_3 = NULL;
13045  int __pyx_lineno = 0;
13046  const char *__pyx_filename = NULL;
13047  int __pyx_clineno = 0;
13048  __Pyx_RefNannySetupContext("__repr__", 0);
13049 
13050  /* "View.MemoryView":612
13051  *
13052  * def __repr__(self):
13053  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13054  * id(self))
13055  *
13056  */
13057  __Pyx_XDECREF(__pyx_r);
13058  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13059  __Pyx_GOTREF(__pyx_t_1);
13060  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13061  __Pyx_GOTREF(__pyx_t_2);
13062  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13063  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13064  __Pyx_GOTREF(__pyx_t_1);
13065  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13066 
13067  /* "View.MemoryView":613
13068  * def __repr__(self):
13069  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13070  * id(self)) # <<<<<<<<<<<<<<
13071  *
13072  * def __str__(self):
13073  */
13074  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
13075  __Pyx_GOTREF(__pyx_t_2);
13076 
13077  /* "View.MemoryView":612
13078  *
13079  * def __repr__(self):
13080  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13081  * id(self))
13082  *
13083  */
13084  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
13085  __Pyx_GOTREF(__pyx_t_3);
13086  __Pyx_GIVEREF(__pyx_t_1);
13087  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13088  __Pyx_GIVEREF(__pyx_t_2);
13089  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13090  __pyx_t_1 = 0;
13091  __pyx_t_2 = 0;
13092  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13093  __Pyx_GOTREF(__pyx_t_2);
13094  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13095  __pyx_r = __pyx_t_2;
13096  __pyx_t_2 = 0;
13097  goto __pyx_L0;
13098 
13099  /* "View.MemoryView":611
13100  * return 0
13101  *
13102  * def __repr__(self): # <<<<<<<<<<<<<<
13103  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13104  * id(self))
13105  */
13106 
13107  /* function exit code */
13108  __pyx_L1_error:;
13109  __Pyx_XDECREF(__pyx_t_1);
13110  __Pyx_XDECREF(__pyx_t_2);
13111  __Pyx_XDECREF(__pyx_t_3);
13112  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13113  __pyx_r = NULL;
13114  __pyx_L0:;
13115  __Pyx_XGIVEREF(__pyx_r);
13116  __Pyx_RefNannyFinishContext();
13117  return __pyx_r;
13118 }
13119 
13120 /* "View.MemoryView":615
13121  * id(self))
13122  *
13123  * def __str__(self): # <<<<<<<<<<<<<<
13124  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13125  *
13126  */
13127 
13128 /* Python wrapper */
13129 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
13130 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13131  PyObject *__pyx_r = 0;
13132  __Pyx_RefNannyDeclarations
13133  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13134  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13135 
13136  /* function exit code */
13137  __Pyx_RefNannyFinishContext();
13138  return __pyx_r;
13139 }
13140 
13141 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
13142  PyObject *__pyx_r = NULL;
13143  __Pyx_RefNannyDeclarations
13144  PyObject *__pyx_t_1 = NULL;
13145  PyObject *__pyx_t_2 = NULL;
13146  int __pyx_lineno = 0;
13147  const char *__pyx_filename = NULL;
13148  int __pyx_clineno = 0;
13149  __Pyx_RefNannySetupContext("__str__", 0);
13150 
13151  /* "View.MemoryView":616
13152  *
13153  * def __str__(self):
13154  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
13155  *
13156  *
13157  */
13158  __Pyx_XDECREF(__pyx_r);
13159  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13160  __Pyx_GOTREF(__pyx_t_1);
13161  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13162  __Pyx_GOTREF(__pyx_t_2);
13163  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13164  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13165  __Pyx_GOTREF(__pyx_t_1);
13166  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13167  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13168  __Pyx_GOTREF(__pyx_t_2);
13169  __Pyx_GIVEREF(__pyx_t_1);
13170  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13171  __pyx_t_1 = 0;
13172  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13173  __Pyx_GOTREF(__pyx_t_1);
13174  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13175  __pyx_r = __pyx_t_1;
13176  __pyx_t_1 = 0;
13177  goto __pyx_L0;
13178 
13179  /* "View.MemoryView":615
13180  * id(self))
13181  *
13182  * def __str__(self): # <<<<<<<<<<<<<<
13183  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13184  *
13185  */
13186 
13187  /* function exit code */
13188  __pyx_L1_error:;
13189  __Pyx_XDECREF(__pyx_t_1);
13190  __Pyx_XDECREF(__pyx_t_2);
13191  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13192  __pyx_r = NULL;
13193  __pyx_L0:;
13194  __Pyx_XGIVEREF(__pyx_r);
13195  __Pyx_RefNannyFinishContext();
13196  return __pyx_r;
13197 }
13198 
13199 /* "View.MemoryView":619
13200  *
13201  *
13202  * def is_c_contig(self): # <<<<<<<<<<<<<<
13203  * cdef __Pyx_memviewslice *mslice
13204  * cdef __Pyx_memviewslice tmp
13205  */
13206 
13207 /* Python wrapper */
13208 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13209 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13210  PyObject *__pyx_r = 0;
13211  __Pyx_RefNannyDeclarations
13212  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
13213  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13214 
13215  /* function exit code */
13216  __Pyx_RefNannyFinishContext();
13217  return __pyx_r;
13218 }
13219 
13220 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13221  __Pyx_memviewslice *__pyx_v_mslice;
13222  __Pyx_memviewslice __pyx_v_tmp;
13223  PyObject *__pyx_r = NULL;
13224  __Pyx_RefNannyDeclarations
13225  __Pyx_memviewslice *__pyx_t_1;
13226  PyObject *__pyx_t_2 = NULL;
13227  int __pyx_lineno = 0;
13228  const char *__pyx_filename = NULL;
13229  int __pyx_clineno = 0;
13230  __Pyx_RefNannySetupContext("is_c_contig", 0);
13231 
13232  /* "View.MemoryView":622
13233  * cdef __Pyx_memviewslice *mslice
13234  * cdef __Pyx_memviewslice tmp
13235  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13236  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13237  *
13238  */
13239  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
13240  __pyx_v_mslice = __pyx_t_1;
13241 
13242  /* "View.MemoryView":623
13243  * cdef __Pyx_memviewslice tmp
13244  * mslice = get_slice_from_memview(self, &tmp)
13245  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
13246  *
13247  * def is_f_contig(self):
13248  */
13249  __Pyx_XDECREF(__pyx_r);
13250  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
13251  __Pyx_GOTREF(__pyx_t_2);
13252  __pyx_r = __pyx_t_2;
13253  __pyx_t_2 = 0;
13254  goto __pyx_L0;
13255 
13256  /* "View.MemoryView":619
13257  *
13258  *
13259  * def is_c_contig(self): # <<<<<<<<<<<<<<
13260  * cdef __Pyx_memviewslice *mslice
13261  * cdef __Pyx_memviewslice tmp
13262  */
13263 
13264  /* function exit code */
13265  __pyx_L1_error:;
13266  __Pyx_XDECREF(__pyx_t_2);
13267  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13268  __pyx_r = NULL;
13269  __pyx_L0:;
13270  __Pyx_XGIVEREF(__pyx_r);
13271  __Pyx_RefNannyFinishContext();
13272  return __pyx_r;
13273 }
13274 
13275 /* "View.MemoryView":625
13276  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13277  *
13278  * def is_f_contig(self): # <<<<<<<<<<<<<<
13279  * cdef __Pyx_memviewslice *mslice
13280  * cdef __Pyx_memviewslice tmp
13281  */
13282 
13283 /* Python wrapper */
13284 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13285 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13286  PyObject *__pyx_r = 0;
13287  __Pyx_RefNannyDeclarations
13288  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
13289  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13290 
13291  /* function exit code */
13292  __Pyx_RefNannyFinishContext();
13293  return __pyx_r;
13294 }
13295 
13296 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13297  __Pyx_memviewslice *__pyx_v_mslice;
13298  __Pyx_memviewslice __pyx_v_tmp;
13299  PyObject *__pyx_r = NULL;
13300  __Pyx_RefNannyDeclarations
13301  __Pyx_memviewslice *__pyx_t_1;
13302  PyObject *__pyx_t_2 = NULL;
13303  int __pyx_lineno = 0;
13304  const char *__pyx_filename = NULL;
13305  int __pyx_clineno = 0;
13306  __Pyx_RefNannySetupContext("is_f_contig", 0);
13307 
13308  /* "View.MemoryView":628
13309  * cdef __Pyx_memviewslice *mslice
13310  * cdef __Pyx_memviewslice tmp
13311  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13312  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13313  *
13314  */
13315  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
13316  __pyx_v_mslice = __pyx_t_1;
13317 
13318  /* "View.MemoryView":629
13319  * cdef __Pyx_memviewslice tmp
13320  * mslice = get_slice_from_memview(self, &tmp)
13321  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
13322  *
13323  * def copy(self):
13324  */
13325  __Pyx_XDECREF(__pyx_r);
13326  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
13327  __Pyx_GOTREF(__pyx_t_2);
13328  __pyx_r = __pyx_t_2;
13329  __pyx_t_2 = 0;
13330  goto __pyx_L0;
13331 
13332  /* "View.MemoryView":625
13333  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13334  *
13335  * def is_f_contig(self): # <<<<<<<<<<<<<<
13336  * cdef __Pyx_memviewslice *mslice
13337  * cdef __Pyx_memviewslice tmp
13338  */
13339 
13340  /* function exit code */
13341  __pyx_L1_error:;
13342  __Pyx_XDECREF(__pyx_t_2);
13343  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13344  __pyx_r = NULL;
13345  __pyx_L0:;
13346  __Pyx_XGIVEREF(__pyx_r);
13347  __Pyx_RefNannyFinishContext();
13348  return __pyx_r;
13349 }
13350 
13351 /* "View.MemoryView":631
13352  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13353  *
13354  * def copy(self): # <<<<<<<<<<<<<<
13355  * cdef __Pyx_memviewslice mslice
13356  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13357  */
13358 
13359 /* Python wrapper */
13360 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13361 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13362  PyObject *__pyx_r = 0;
13363  __Pyx_RefNannyDeclarations
13364  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
13365  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
13366 
13367  /* function exit code */
13368  __Pyx_RefNannyFinishContext();
13369  return __pyx_r;
13370 }
13371 
13372 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
13373  __Pyx_memviewslice __pyx_v_mslice;
13374  int __pyx_v_flags;
13375  PyObject *__pyx_r = NULL;
13376  __Pyx_RefNannyDeclarations
13377  __Pyx_memviewslice __pyx_t_1;
13378  PyObject *__pyx_t_2 = NULL;
13379  int __pyx_lineno = 0;
13380  const char *__pyx_filename = NULL;
13381  int __pyx_clineno = 0;
13382  __Pyx_RefNannySetupContext("copy", 0);
13383 
13384  /* "View.MemoryView":633
13385  * def copy(self):
13386  * cdef __Pyx_memviewslice mslice
13387  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
13388  *
13389  * slice_copy(self, &mslice)
13390  */
13391  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13392 
13393  /* "View.MemoryView":635
13394  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13395  *
13396  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
13397  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
13398  * self.view.itemsize,
13399  */
13400  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13401 
13402  /* "View.MemoryView":636
13403  *
13404  * slice_copy(self, &mslice)
13405  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
13406  * self.view.itemsize,
13407  * flags|PyBUF_C_CONTIGUOUS,
13408  */
13409  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
13410  __pyx_v_mslice = __pyx_t_1;
13411 
13412  /* "View.MemoryView":641
13413  * self.dtype_is_object)
13414  *
13415  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
13416  *
13417  * def copy_fortran(self):
13418  */
13419  __Pyx_XDECREF(__pyx_r);
13420  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
13421  __Pyx_GOTREF(__pyx_t_2);
13422  __pyx_r = __pyx_t_2;
13423  __pyx_t_2 = 0;
13424  goto __pyx_L0;
13425 
13426  /* "View.MemoryView":631
13427  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13428  *
13429  * def copy(self): # <<<<<<<<<<<<<<
13430  * cdef __Pyx_memviewslice mslice
13431  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13432  */
13433 
13434  /* function exit code */
13435  __pyx_L1_error:;
13436  __Pyx_XDECREF(__pyx_t_2);
13437  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13438  __pyx_r = NULL;
13439  __pyx_L0:;
13440  __Pyx_XGIVEREF(__pyx_r);
13441  __Pyx_RefNannyFinishContext();
13442  return __pyx_r;
13443 }
13444 
13445 /* "View.MemoryView":643
13446  * return memoryview_copy_from_slice(self, &mslice)
13447  *
13448  * def copy_fortran(self): # <<<<<<<<<<<<<<
13449  * cdef __Pyx_memviewslice src, dst
13450  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13451  */
13452 
13453 /* Python wrapper */
13454 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13455 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13456  PyObject *__pyx_r = 0;
13457  __Pyx_RefNannyDeclarations
13458  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
13459  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
13460 
13461  /* function exit code */
13462  __Pyx_RefNannyFinishContext();
13463  return __pyx_r;
13464 }
13465 
13466 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
13467  __Pyx_memviewslice __pyx_v_src;
13468  __Pyx_memviewslice __pyx_v_dst;
13469  int __pyx_v_flags;
13470  PyObject *__pyx_r = NULL;
13471  __Pyx_RefNannyDeclarations
13472  __Pyx_memviewslice __pyx_t_1;
13473  PyObject *__pyx_t_2 = NULL;
13474  int __pyx_lineno = 0;
13475  const char *__pyx_filename = NULL;
13476  int __pyx_clineno = 0;
13477  __Pyx_RefNannySetupContext("copy_fortran", 0);
13478 
13479  /* "View.MemoryView":645
13480  * def copy_fortran(self):
13481  * cdef __Pyx_memviewslice src, dst
13482  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
13483  *
13484  * slice_copy(self, &src)
13485  */
13486  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13487 
13488  /* "View.MemoryView":647
13489  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13490  *
13491  * slice_copy(self, &src) # <<<<<<<<<<<<<<
13492  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
13493  * self.view.itemsize,
13494  */
13495  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13496 
13497  /* "View.MemoryView":648
13498  *
13499  * slice_copy(self, &src)
13500  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
13501  * self.view.itemsize,
13502  * flags|PyBUF_F_CONTIGUOUS,
13503  */
13504  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
13505  __pyx_v_dst = __pyx_t_1;
13506 
13507  /* "View.MemoryView":653
13508  * self.dtype_is_object)
13509  *
13510  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
13511  *
13512  *
13513  */
13514  __Pyx_XDECREF(__pyx_r);
13515  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
13516  __Pyx_GOTREF(__pyx_t_2);
13517  __pyx_r = __pyx_t_2;
13518  __pyx_t_2 = 0;
13519  goto __pyx_L0;
13520 
13521  /* "View.MemoryView":643
13522  * return memoryview_copy_from_slice(self, &mslice)
13523  *
13524  * def copy_fortran(self): # <<<<<<<<<<<<<<
13525  * cdef __Pyx_memviewslice src, dst
13526  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13527  */
13528 
13529  /* function exit code */
13530  __pyx_L1_error:;
13531  __Pyx_XDECREF(__pyx_t_2);
13532  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
13533  __pyx_r = NULL;
13534  __pyx_L0:;
13535  __Pyx_XGIVEREF(__pyx_r);
13536  __Pyx_RefNannyFinishContext();
13537  return __pyx_r;
13538 }
13539 
13540 /* "(tree fragment)":1
13541  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13542  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13543  * def __setstate_cython__(self, __pyx_state):
13544  */
13545 
13546 /* Python wrapper */
13547 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13548 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13549  PyObject *__pyx_r = 0;
13550  __Pyx_RefNannyDeclarations
13551  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13552  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13553 
13554  /* function exit code */
13555  __Pyx_RefNannyFinishContext();
13556  return __pyx_r;
13557 }
13558 
13559 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
13560  PyObject *__pyx_r = NULL;
13561  __Pyx_RefNannyDeclarations
13562  PyObject *__pyx_t_1 = NULL;
13563  int __pyx_lineno = 0;
13564  const char *__pyx_filename = NULL;
13565  int __pyx_clineno = 0;
13566  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13567 
13568  /* "(tree fragment)":2
13569  * def __reduce_cython__(self):
13570  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13571  * def __setstate_cython__(self, __pyx_state):
13572  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13573  */
13574  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13575  __Pyx_GOTREF(__pyx_t_1);
13576  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13577  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13578  __PYX_ERR(1, 2, __pyx_L1_error)
13579 
13580  /* "(tree fragment)":1
13581  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13582  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13583  * def __setstate_cython__(self, __pyx_state):
13584  */
13585 
13586  /* function exit code */
13587  __pyx_L1_error:;
13588  __Pyx_XDECREF(__pyx_t_1);
13589  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13590  __pyx_r = NULL;
13591  __Pyx_XGIVEREF(__pyx_r);
13592  __Pyx_RefNannyFinishContext();
13593  return __pyx_r;
13594 }
13595 
13596 /* "(tree fragment)":3
13597  * def __reduce_cython__(self):
13598  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13599  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13600  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13601  */
13602 
13603 /* Python wrapper */
13604 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
13605 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13606  PyObject *__pyx_r = 0;
13607  __Pyx_RefNannyDeclarations
13608  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13609  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13610 
13611  /* function exit code */
13612  __Pyx_RefNannyFinishContext();
13613  return __pyx_r;
13614 }
13615 
13616 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13617  PyObject *__pyx_r = NULL;
13618  __Pyx_RefNannyDeclarations
13619  PyObject *__pyx_t_1 = NULL;
13620  int __pyx_lineno = 0;
13621  const char *__pyx_filename = NULL;
13622  int __pyx_clineno = 0;
13623  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
13624 
13625  /* "(tree fragment)":4
13626  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13627  * def __setstate_cython__(self, __pyx_state):
13628  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13629  */
13630  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
13631  __Pyx_GOTREF(__pyx_t_1);
13632  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13633  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13634  __PYX_ERR(1, 4, __pyx_L1_error)
13635 
13636  /* "(tree fragment)":3
13637  * def __reduce_cython__(self):
13638  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13639  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13640  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13641  */
13642 
13643  /* function exit code */
13644  __pyx_L1_error:;
13645  __Pyx_XDECREF(__pyx_t_1);
13646  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13647  __pyx_r = NULL;
13648  __Pyx_XGIVEREF(__pyx_r);
13649  __Pyx_RefNannyFinishContext();
13650  return __pyx_r;
13651 }
13652 
13653 /* "View.MemoryView":657
13654  *
13655  * @cname('__pyx_memoryview_new')
13656  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13657  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13658  * result.typeinfo = typeinfo
13659  */
13660 
13661 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
13662  struct __pyx_memoryview_obj *__pyx_v_result = 0;
13663  PyObject *__pyx_r = NULL;
13664  __Pyx_RefNannyDeclarations
13665  PyObject *__pyx_t_1 = NULL;
13666  PyObject *__pyx_t_2 = NULL;
13667  PyObject *__pyx_t_3 = NULL;
13668  int __pyx_lineno = 0;
13669  const char *__pyx_filename = NULL;
13670  int __pyx_clineno = 0;
13671  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
13672 
13673  /* "View.MemoryView":658
13674  * @cname('__pyx_memoryview_new')
13675  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13676  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
13677  * result.typeinfo = typeinfo
13678  * return result
13679  */
13680  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
13681  __Pyx_GOTREF(__pyx_t_1);
13682  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
13683  __Pyx_GOTREF(__pyx_t_2);
13684  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
13685  __Pyx_GOTREF(__pyx_t_3);
13686  __Pyx_INCREF(__pyx_v_o);
13687  __Pyx_GIVEREF(__pyx_v_o);
13688  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
13689  __Pyx_GIVEREF(__pyx_t_1);
13690  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
13691  __Pyx_GIVEREF(__pyx_t_2);
13692  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
13693  __pyx_t_1 = 0;
13694  __pyx_t_2 = 0;
13695  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
13696  __Pyx_GOTREF(__pyx_t_2);
13697  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13698  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13699  __pyx_t_2 = 0;
13700 
13701  /* "View.MemoryView":659
13702  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13703  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13704  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
13705  * return result
13706  *
13707  */
13708  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
13709 
13710  /* "View.MemoryView":660
13711  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13712  * result.typeinfo = typeinfo
13713  * return result # <<<<<<<<<<<<<<
13714  *
13715  * @cname('__pyx_memoryview_check')
13716  */
13717  __Pyx_XDECREF(__pyx_r);
13718  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13719  __pyx_r = ((PyObject *)__pyx_v_result);
13720  goto __pyx_L0;
13721 
13722  /* "View.MemoryView":657
13723  *
13724  * @cname('__pyx_memoryview_new')
13725  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13726  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13727  * result.typeinfo = typeinfo
13728  */
13729 
13730  /* function exit code */
13731  __pyx_L1_error:;
13732  __Pyx_XDECREF(__pyx_t_1);
13733  __Pyx_XDECREF(__pyx_t_2);
13734  __Pyx_XDECREF(__pyx_t_3);
13735  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13736  __pyx_r = 0;
13737  __pyx_L0:;
13738  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13739  __Pyx_XGIVEREF(__pyx_r);
13740  __Pyx_RefNannyFinishContext();
13741  return __pyx_r;
13742 }
13743 
13744 /* "View.MemoryView":663
13745  *
13746  * @cname('__pyx_memoryview_check')
13747  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
13748  * return isinstance(o, memoryview)
13749  *
13750  */
13751 
13752 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
13753  int __pyx_r;
13754  __Pyx_RefNannyDeclarations
13755  int __pyx_t_1;
13756  __Pyx_RefNannySetupContext("memoryview_check", 0);
13757 
13758  /* "View.MemoryView":664
13759  * @cname('__pyx_memoryview_check')
13760  * cdef inline bint memoryview_check(object o):
13761  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
13762  *
13763  * cdef tuple _unellipsify(object index, int ndim):
13764  */
13765  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
13766  __pyx_r = __pyx_t_1;
13767  goto __pyx_L0;
13768 
13769  /* "View.MemoryView":663
13770  *
13771  * @cname('__pyx_memoryview_check')
13772  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
13773  * return isinstance(o, memoryview)
13774  *
13775  */
13776 
13777  /* function exit code */
13778  __pyx_L0:;
13779  __Pyx_RefNannyFinishContext();
13780  return __pyx_r;
13781 }
13782 
13783 /* "View.MemoryView":666
13784  * return isinstance(o, memoryview)
13785  *
13786  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13787  * """
13788  * Replace all ellipses with full slices and fill incomplete indices with
13789  */
13790 
13791 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
13792  PyObject *__pyx_v_tup = NULL;
13793  PyObject *__pyx_v_result = NULL;
13794  int __pyx_v_have_slices;
13795  int __pyx_v_seen_ellipsis;
13796  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
13797  PyObject *__pyx_v_item = NULL;
13798  Py_ssize_t __pyx_v_nslices;
13799  PyObject *__pyx_r = NULL;
13800  __Pyx_RefNannyDeclarations
13801  int __pyx_t_1;
13802  int __pyx_t_2;
13803  PyObject *__pyx_t_3 = NULL;
13804  PyObject *__pyx_t_4 = NULL;
13805  Py_ssize_t __pyx_t_5;
13806  PyObject *(*__pyx_t_6)(PyObject *);
13807  PyObject *__pyx_t_7 = NULL;
13808  Py_ssize_t __pyx_t_8;
13809  int __pyx_t_9;
13810  int __pyx_t_10;
13811  PyObject *__pyx_t_11 = NULL;
13812  int __pyx_lineno = 0;
13813  const char *__pyx_filename = NULL;
13814  int __pyx_clineno = 0;
13815  __Pyx_RefNannySetupContext("_unellipsify", 0);
13816 
13817  /* "View.MemoryView":671
13818  * full slices.
13819  * """
13820  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
13821  * tup = (index,)
13822  * else:
13823  */
13824  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13825  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13826  if (__pyx_t_2) {
13827 
13828  /* "View.MemoryView":672
13829  * """
13830  * if not isinstance(index, tuple):
13831  * tup = (index,) # <<<<<<<<<<<<<<
13832  * else:
13833  * tup = index
13834  */
13835  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
13836  __Pyx_GOTREF(__pyx_t_3);
13837  __Pyx_INCREF(__pyx_v_index);
13838  __Pyx_GIVEREF(__pyx_v_index);
13839  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
13840  __pyx_v_tup = __pyx_t_3;
13841  __pyx_t_3 = 0;
13842 
13843  /* "View.MemoryView":671
13844  * full slices.
13845  * """
13846  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
13847  * tup = (index,)
13848  * else:
13849  */
13850  goto __pyx_L3;
13851  }
13852 
13853  /* "View.MemoryView":674
13854  * tup = (index,)
13855  * else:
13856  * tup = index # <<<<<<<<<<<<<<
13857  *
13858  * result = []
13859  */
13860  /*else*/ {
13861  __Pyx_INCREF(__pyx_v_index);
13862  __pyx_v_tup = __pyx_v_index;
13863  }
13864  __pyx_L3:;
13865 
13866  /* "View.MemoryView":676
13867  * tup = index
13868  *
13869  * result = [] # <<<<<<<<<<<<<<
13870  * have_slices = False
13871  * seen_ellipsis = False
13872  */
13873  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
13874  __Pyx_GOTREF(__pyx_t_3);
13875  __pyx_v_result = ((PyObject*)__pyx_t_3);
13876  __pyx_t_3 = 0;
13877 
13878  /* "View.MemoryView":677
13879  *
13880  * result = []
13881  * have_slices = False # <<<<<<<<<<<<<<
13882  * seen_ellipsis = False
13883  * for idx, item in enumerate(tup):
13884  */
13885  __pyx_v_have_slices = 0;
13886 
13887  /* "View.MemoryView":678
13888  * result = []
13889  * have_slices = False
13890  * seen_ellipsis = False # <<<<<<<<<<<<<<
13891  * for idx, item in enumerate(tup):
13892  * if item is Ellipsis:
13893  */
13894  __pyx_v_seen_ellipsis = 0;
13895 
13896  /* "View.MemoryView":679
13897  * have_slices = False
13898  * seen_ellipsis = False
13899  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
13900  * if item is Ellipsis:
13901  * if not seen_ellipsis:
13902  */
13903  __Pyx_INCREF(__pyx_int_0);
13904  __pyx_t_3 = __pyx_int_0;
13905  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
13906  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
13907  __pyx_t_6 = NULL;
13908  } else {
13909  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
13910  __Pyx_GOTREF(__pyx_t_4);
13911  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
13912  }
13913  for (;;) {
13914  if (likely(!__pyx_t_6)) {
13915  if (likely(PyList_CheckExact(__pyx_t_4))) {
13916  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
13917  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13918  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
13919  #else
13920  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
13921  __Pyx_GOTREF(__pyx_t_7);
13922  #endif
13923  } else {
13924  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
13925  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13926  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
13927  #else
13928  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
13929  __Pyx_GOTREF(__pyx_t_7);
13930  #endif
13931  }
13932  } else {
13933  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
13934  if (unlikely(!__pyx_t_7)) {
13935  PyObject* exc_type = PyErr_Occurred();
13936  if (exc_type) {
13937  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13938  else __PYX_ERR(1, 679, __pyx_L1_error)
13939  }
13940  break;
13941  }
13942  __Pyx_GOTREF(__pyx_t_7);
13943  }
13944  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
13945  __pyx_t_7 = 0;
13946  __Pyx_INCREF(__pyx_t_3);
13947  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
13948  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
13949  __Pyx_GOTREF(__pyx_t_7);
13950  __Pyx_DECREF(__pyx_t_3);
13951  __pyx_t_3 = __pyx_t_7;
13952  __pyx_t_7 = 0;
13953 
13954  /* "View.MemoryView":680
13955  * seen_ellipsis = False
13956  * for idx, item in enumerate(tup):
13957  * if item is Ellipsis: # <<<<<<<<<<<<<<
13958  * if not seen_ellipsis:
13959  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13960  */
13961  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
13962  __pyx_t_1 = (__pyx_t_2 != 0);
13963  if (__pyx_t_1) {
13964 
13965  /* "View.MemoryView":681
13966  * for idx, item in enumerate(tup):
13967  * if item is Ellipsis:
13968  * if not seen_ellipsis: # <<<<<<<<<<<<<<
13969  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13970  * seen_ellipsis = True
13971  */
13972  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
13973  if (__pyx_t_1) {
13974 
13975  /* "View.MemoryView":682
13976  * if item is Ellipsis:
13977  * if not seen_ellipsis:
13978  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
13979  * seen_ellipsis = True
13980  * else:
13981  */
13982  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
13983  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
13984  __Pyx_GOTREF(__pyx_t_7);
13985  { Py_ssize_t __pyx_temp;
13986  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
13987  __Pyx_INCREF(__pyx_slice__22);
13988  __Pyx_GIVEREF(__pyx_slice__22);
13989  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__22);
13990  }
13991  }
13992  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
13993  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13994 
13995  /* "View.MemoryView":683
13996  * if not seen_ellipsis:
13997  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13998  * seen_ellipsis = True # <<<<<<<<<<<<<<
13999  * else:
14000  * result.append(slice(None))
14001  */
14002  __pyx_v_seen_ellipsis = 1;
14003 
14004  /* "View.MemoryView":681
14005  * for idx, item in enumerate(tup):
14006  * if item is Ellipsis:
14007  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14008  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14009  * seen_ellipsis = True
14010  */
14011  goto __pyx_L7;
14012  }
14013 
14014  /* "View.MemoryView":685
14015  * seen_ellipsis = True
14016  * else:
14017  * result.append(slice(None)) # <<<<<<<<<<<<<<
14018  * have_slices = True
14019  * else:
14020  */
14021  /*else*/ {
14022  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__22); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
14023  }
14024  __pyx_L7:;
14025 
14026  /* "View.MemoryView":686
14027  * else:
14028  * result.append(slice(None))
14029  * have_slices = True # <<<<<<<<<<<<<<
14030  * else:
14031  * if not isinstance(item, slice) and not PyIndex_Check(item):
14032  */
14033  __pyx_v_have_slices = 1;
14034 
14035  /* "View.MemoryView":680
14036  * seen_ellipsis = False
14037  * for idx, item in enumerate(tup):
14038  * if item is Ellipsis: # <<<<<<<<<<<<<<
14039  * if not seen_ellipsis:
14040  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14041  */
14042  goto __pyx_L6;
14043  }
14044 
14045  /* "View.MemoryView":688
14046  * have_slices = True
14047  * else:
14048  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14049  * raise TypeError("Cannot index with type '%s'" % type(item))
14050  *
14051  */
14052  /*else*/ {
14053  __pyx_t_2 = PySlice_Check(__pyx_v_item);
14054  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14055  if (__pyx_t_10) {
14056  } else {
14057  __pyx_t_1 = __pyx_t_10;
14058  goto __pyx_L9_bool_binop_done;
14059  }
14060  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14061  __pyx_t_1 = __pyx_t_10;
14062  __pyx_L9_bool_binop_done:;
14063  if (unlikely(__pyx_t_1)) {
14064 
14065  /* "View.MemoryView":689
14066  * else:
14067  * if not isinstance(item, slice) and not PyIndex_Check(item):
14068  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
14069  *
14070  * have_slices = have_slices or isinstance(item, slice)
14071  */
14072  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
14073  __Pyx_GOTREF(__pyx_t_7);
14074  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
14075  __Pyx_GOTREF(__pyx_t_11);
14076  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14077  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14078  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14079  __PYX_ERR(1, 689, __pyx_L1_error)
14080 
14081  /* "View.MemoryView":688
14082  * have_slices = True
14083  * else:
14084  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14085  * raise TypeError("Cannot index with type '%s'" % type(item))
14086  *
14087  */
14088  }
14089 
14090  /* "View.MemoryView":691
14091  * raise TypeError("Cannot index with type '%s'" % type(item))
14092  *
14093  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
14094  * result.append(item)
14095  *
14096  */
14097  __pyx_t_10 = (__pyx_v_have_slices != 0);
14098  if (!__pyx_t_10) {
14099  } else {
14100  __pyx_t_1 = __pyx_t_10;
14101  goto __pyx_L11_bool_binop_done;
14102  }
14103  __pyx_t_10 = PySlice_Check(__pyx_v_item);
14104  __pyx_t_2 = (__pyx_t_10 != 0);
14105  __pyx_t_1 = __pyx_t_2;
14106  __pyx_L11_bool_binop_done:;
14107  __pyx_v_have_slices = __pyx_t_1;
14108 
14109  /* "View.MemoryView":692
14110  *
14111  * have_slices = have_slices or isinstance(item, slice)
14112  * result.append(item) # <<<<<<<<<<<<<<
14113  *
14114  * nslices = ndim - len(result)
14115  */
14116  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
14117  }
14118  __pyx_L6:;
14119 
14120  /* "View.MemoryView":679
14121  * have_slices = False
14122  * seen_ellipsis = False
14123  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14124  * if item is Ellipsis:
14125  * if not seen_ellipsis:
14126  */
14127  }
14128  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14129  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14130 
14131  /* "View.MemoryView":694
14132  * result.append(item)
14133  *
14134  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
14135  * if nslices:
14136  * result.extend([slice(None)] * nslices)
14137  */
14138  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
14139  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14140 
14141  /* "View.MemoryView":695
14142  *
14143  * nslices = ndim - len(result)
14144  * if nslices: # <<<<<<<<<<<<<<
14145  * result.extend([slice(None)] * nslices)
14146  *
14147  */
14148  __pyx_t_1 = (__pyx_v_nslices != 0);
14149  if (__pyx_t_1) {
14150 
14151  /* "View.MemoryView":696
14152  * nslices = ndim - len(result)
14153  * if nslices:
14154  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
14155  *
14156  * return have_slices or nslices, tuple(result)
14157  */
14158  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
14159  __Pyx_GOTREF(__pyx_t_3);
14160  { Py_ssize_t __pyx_temp;
14161  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14162  __Pyx_INCREF(__pyx_slice__22);
14163  __Pyx_GIVEREF(__pyx_slice__22);
14164  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__22);
14165  }
14166  }
14167  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
14168  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14169 
14170  /* "View.MemoryView":695
14171  *
14172  * nslices = ndim - len(result)
14173  * if nslices: # <<<<<<<<<<<<<<
14174  * result.extend([slice(None)] * nslices)
14175  *
14176  */
14177  }
14178 
14179  /* "View.MemoryView":698
14180  * result.extend([slice(None)] * nslices)
14181  *
14182  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
14183  *
14184  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14185  */
14186  __Pyx_XDECREF(__pyx_r);
14187  if (!__pyx_v_have_slices) {
14188  } else {
14189  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14190  __Pyx_GOTREF(__pyx_t_4);
14191  __pyx_t_3 = __pyx_t_4;
14192  __pyx_t_4 = 0;
14193  goto __pyx_L14_bool_binop_done;
14194  }
14195  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14196  __Pyx_GOTREF(__pyx_t_4);
14197  __pyx_t_3 = __pyx_t_4;
14198  __pyx_t_4 = 0;
14199  __pyx_L14_bool_binop_done:;
14200  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14201  __Pyx_GOTREF(__pyx_t_4);
14202  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
14203  __Pyx_GOTREF(__pyx_t_11);
14204  __Pyx_GIVEREF(__pyx_t_3);
14205  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14206  __Pyx_GIVEREF(__pyx_t_4);
14207  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14208  __pyx_t_3 = 0;
14209  __pyx_t_4 = 0;
14210  __pyx_r = ((PyObject*)__pyx_t_11);
14211  __pyx_t_11 = 0;
14212  goto __pyx_L0;
14213 
14214  /* "View.MemoryView":666
14215  * return isinstance(o, memoryview)
14216  *
14217  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14218  * """
14219  * Replace all ellipses with full slices and fill incomplete indices with
14220  */
14221 
14222  /* function exit code */
14223  __pyx_L1_error:;
14224  __Pyx_XDECREF(__pyx_t_3);
14225  __Pyx_XDECREF(__pyx_t_4);
14226  __Pyx_XDECREF(__pyx_t_7);
14227  __Pyx_XDECREF(__pyx_t_11);
14228  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14229  __pyx_r = 0;
14230  __pyx_L0:;
14231  __Pyx_XDECREF(__pyx_v_tup);
14232  __Pyx_XDECREF(__pyx_v_result);
14233  __Pyx_XDECREF(__pyx_v_idx);
14234  __Pyx_XDECREF(__pyx_v_item);
14235  __Pyx_XGIVEREF(__pyx_r);
14236  __Pyx_RefNannyFinishContext();
14237  return __pyx_r;
14238 }
14239 
14240 /* "View.MemoryView":700
14241  * return have_slices or nslices, tuple(result)
14242  *
14243  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14244  * for suboffset in suboffsets[:ndim]:
14245  * if suboffset >= 0:
14246  */
14247 
14248 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
14249  Py_ssize_t __pyx_v_suboffset;
14250  PyObject *__pyx_r = NULL;
14251  __Pyx_RefNannyDeclarations
14252  Py_ssize_t *__pyx_t_1;
14253  Py_ssize_t *__pyx_t_2;
14254  Py_ssize_t *__pyx_t_3;
14255  int __pyx_t_4;
14256  PyObject *__pyx_t_5 = NULL;
14257  int __pyx_lineno = 0;
14258  const char *__pyx_filename = NULL;
14259  int __pyx_clineno = 0;
14260  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
14261 
14262  /* "View.MemoryView":701
14263  *
14264  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14265  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
14266  * if suboffset >= 0:
14267  * raise ValueError("Indirect dimensions not supported")
14268  */
14269  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14270  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14271  __pyx_t_1 = __pyx_t_3;
14272  __pyx_v_suboffset = (__pyx_t_1[0]);
14273 
14274  /* "View.MemoryView":702
14275  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14276  * for suboffset in suboffsets[:ndim]:
14277  * if suboffset >= 0: # <<<<<<<<<<<<<<
14278  * raise ValueError("Indirect dimensions not supported")
14279  *
14280  */
14281  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14282  if (unlikely(__pyx_t_4)) {
14283 
14284  /* "View.MemoryView":703
14285  * for suboffset in suboffsets[:ndim]:
14286  * if suboffset >= 0:
14287  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
14288  *
14289  *
14290  */
14291  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
14292  __Pyx_GOTREF(__pyx_t_5);
14293  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14294  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14295  __PYX_ERR(1, 703, __pyx_L1_error)
14296 
14297  /* "View.MemoryView":702
14298  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14299  * for suboffset in suboffsets[:ndim]:
14300  * if suboffset >= 0: # <<<<<<<<<<<<<<
14301  * raise ValueError("Indirect dimensions not supported")
14302  *
14303  */
14304  }
14305  }
14306 
14307  /* "View.MemoryView":700
14308  * return have_slices or nslices, tuple(result)
14309  *
14310  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14311  * for suboffset in suboffsets[:ndim]:
14312  * if suboffset >= 0:
14313  */
14314 
14315  /* function exit code */
14316  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14317  goto __pyx_L0;
14318  __pyx_L1_error:;
14319  __Pyx_XDECREF(__pyx_t_5);
14320  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14321  __pyx_r = 0;
14322  __pyx_L0:;
14323  __Pyx_XGIVEREF(__pyx_r);
14324  __Pyx_RefNannyFinishContext();
14325  return __pyx_r;
14326 }
14327 
14328 /* "View.MemoryView":710
14329  *
14330  * @cname('__pyx_memview_slice')
14331  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14332  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14333  * cdef bint negative_step
14334  */
14335 
14336 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14337  int __pyx_v_new_ndim;
14338  int __pyx_v_suboffset_dim;
14339  int __pyx_v_dim;
14340  __Pyx_memviewslice __pyx_v_src;
14341  __Pyx_memviewslice __pyx_v_dst;
14342  __Pyx_memviewslice *__pyx_v_p_src;
14343  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14344  __Pyx_memviewslice *__pyx_v_p_dst;
14345  int *__pyx_v_p_suboffset_dim;
14346  Py_ssize_t __pyx_v_start;
14347  Py_ssize_t __pyx_v_stop;
14348  Py_ssize_t __pyx_v_step;
14349  int __pyx_v_have_start;
14350  int __pyx_v_have_stop;
14351  int __pyx_v_have_step;
14352  PyObject *__pyx_v_index = NULL;
14353  struct __pyx_memoryview_obj *__pyx_r = NULL;
14354  __Pyx_RefNannyDeclarations
14355  int __pyx_t_1;
14356  int __pyx_t_2;
14357  PyObject *__pyx_t_3 = NULL;
14358  struct __pyx_memoryview_obj *__pyx_t_4;
14359  char *__pyx_t_5;
14360  int __pyx_t_6;
14361  Py_ssize_t __pyx_t_7;
14362  PyObject *(*__pyx_t_8)(PyObject *);
14363  PyObject *__pyx_t_9 = NULL;
14364  Py_ssize_t __pyx_t_10;
14365  int __pyx_t_11;
14366  Py_ssize_t __pyx_t_12;
14367  int __pyx_lineno = 0;
14368  const char *__pyx_filename = NULL;
14369  int __pyx_clineno = 0;
14370  __Pyx_RefNannySetupContext("memview_slice", 0);
14371 
14372  /* "View.MemoryView":711
14373  * @cname('__pyx_memview_slice')
14374  * cdef memoryview memview_slice(memoryview memview, object indices):
14375  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
14376  * cdef bint negative_step
14377  * cdef __Pyx_memviewslice src, dst
14378  */
14379  __pyx_v_new_ndim = 0;
14380  __pyx_v_suboffset_dim = -1;
14381 
14382  /* "View.MemoryView":718
14383  *
14384  *
14385  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
14386  *
14387  * cdef _memoryviewslice memviewsliceobj
14388  */
14389  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
14390 
14391  /* "View.MemoryView":722
14392  * cdef _memoryviewslice memviewsliceobj
14393  *
14394  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
14395  *
14396  * if isinstance(memview, _memoryviewslice):
14397  */
14398  #ifndef CYTHON_WITHOUT_ASSERTIONS
14399  if (unlikely(!Py_OptimizeFlag)) {
14400  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14401  PyErr_SetNone(PyExc_AssertionError);
14402  __PYX_ERR(1, 722, __pyx_L1_error)
14403  }
14404  }
14405  #endif
14406 
14407  /* "View.MemoryView":724
14408  * assert memview.view.ndim > 0
14409  *
14410  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14411  * memviewsliceobj = memview
14412  * p_src = &memviewsliceobj.from_slice
14413  */
14414  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14415  __pyx_t_2 = (__pyx_t_1 != 0);
14416  if (__pyx_t_2) {
14417 
14418  /* "View.MemoryView":725
14419  *
14420  * if isinstance(memview, _memoryviewslice):
14421  * memviewsliceobj = memview # <<<<<<<<<<<<<<
14422  * p_src = &memviewsliceobj.from_slice
14423  * else:
14424  */
14425  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
14426  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14427  __Pyx_INCREF(__pyx_t_3);
14428  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14429  __pyx_t_3 = 0;
14430 
14431  /* "View.MemoryView":726
14432  * if isinstance(memview, _memoryviewslice):
14433  * memviewsliceobj = memview
14434  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
14435  * else:
14436  * slice_copy(memview, &src)
14437  */
14438  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14439 
14440  /* "View.MemoryView":724
14441  * assert memview.view.ndim > 0
14442  *
14443  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14444  * memviewsliceobj = memview
14445  * p_src = &memviewsliceobj.from_slice
14446  */
14447  goto __pyx_L3;
14448  }
14449 
14450  /* "View.MemoryView":728
14451  * p_src = &memviewsliceobj.from_slice
14452  * else:
14453  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
14454  * p_src = &src
14455  *
14456  */
14457  /*else*/ {
14458  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14459 
14460  /* "View.MemoryView":729
14461  * else:
14462  * slice_copy(memview, &src)
14463  * p_src = &src # <<<<<<<<<<<<<<
14464  *
14465  *
14466  */
14467  __pyx_v_p_src = (&__pyx_v_src);
14468  }
14469  __pyx_L3:;
14470 
14471  /* "View.MemoryView":735
14472  *
14473  *
14474  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
14475  * dst.data = p_src.data
14476  *
14477  */
14478  __pyx_t_4 = __pyx_v_p_src->memview;
14479  __pyx_v_dst.memview = __pyx_t_4;
14480 
14481  /* "View.MemoryView":736
14482  *
14483  * dst.memview = p_src.memview
14484  * dst.data = p_src.data # <<<<<<<<<<<<<<
14485  *
14486  *
14487  */
14488  __pyx_t_5 = __pyx_v_p_src->data;
14489  __pyx_v_dst.data = __pyx_t_5;
14490 
14491  /* "View.MemoryView":741
14492  *
14493  *
14494  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
14495  * cdef int *p_suboffset_dim = &suboffset_dim
14496  * cdef Py_ssize_t start, stop, step
14497  */
14498  __pyx_v_p_dst = (&__pyx_v_dst);
14499 
14500  /* "View.MemoryView":742
14501  *
14502  * cdef __Pyx_memviewslice *p_dst = &dst
14503  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
14504  * cdef Py_ssize_t start, stop, step
14505  * cdef bint have_start, have_stop, have_step
14506  */
14507  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14508 
14509  /* "View.MemoryView":746
14510  * cdef bint have_start, have_stop, have_step
14511  *
14512  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14513  * if PyIndex_Check(index):
14514  * slice_memviewslice(
14515  */
14516  __pyx_t_6 = 0;
14517  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14518  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
14519  __pyx_t_8 = NULL;
14520  } else {
14521  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
14522  __Pyx_GOTREF(__pyx_t_3);
14523  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
14524  }
14525  for (;;) {
14526  if (likely(!__pyx_t_8)) {
14527  if (likely(PyList_CheckExact(__pyx_t_3))) {
14528  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
14529  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14530  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
14531  #else
14532  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
14533  __Pyx_GOTREF(__pyx_t_9);
14534  #endif
14535  } else {
14536  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
14537  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14538  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
14539  #else
14540  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
14541  __Pyx_GOTREF(__pyx_t_9);
14542  #endif
14543  }
14544  } else {
14545  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
14546  if (unlikely(!__pyx_t_9)) {
14547  PyObject* exc_type = PyErr_Occurred();
14548  if (exc_type) {
14549  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14550  else __PYX_ERR(1, 746, __pyx_L1_error)
14551  }
14552  break;
14553  }
14554  __Pyx_GOTREF(__pyx_t_9);
14555  }
14556  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
14557  __pyx_t_9 = 0;
14558  __pyx_v_dim = __pyx_t_6;
14559  __pyx_t_6 = (__pyx_t_6 + 1);
14560 
14561  /* "View.MemoryView":747
14562  *
14563  * for dim, index in enumerate(indices):
14564  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14565  * slice_memviewslice(
14566  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14567  */
14568  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
14569  if (__pyx_t_2) {
14570 
14571  /* "View.MemoryView":751
14572  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14573  * dim, new_ndim, p_suboffset_dim,
14574  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
14575  * 0, 0, 0, # have_{start,stop,step}
14576  * False)
14577  */
14578  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
14579 
14580  /* "View.MemoryView":748
14581  * for dim, index in enumerate(indices):
14582  * if PyIndex_Check(index):
14583  * slice_memviewslice( # <<<<<<<<<<<<<<
14584  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14585  * dim, new_ndim, p_suboffset_dim,
14586  */
14587  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
14588 
14589  /* "View.MemoryView":747
14590  *
14591  * for dim, index in enumerate(indices):
14592  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14593  * slice_memviewslice(
14594  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14595  */
14596  goto __pyx_L6;
14597  }
14598 
14599  /* "View.MemoryView":754
14600  * 0, 0, 0, # have_{start,stop,step}
14601  * False)
14602  * elif index is None: # <<<<<<<<<<<<<<
14603  * p_dst.shape[new_ndim] = 1
14604  * p_dst.strides[new_ndim] = 0
14605  */
14606  __pyx_t_2 = (__pyx_v_index == Py_None);
14607  __pyx_t_1 = (__pyx_t_2 != 0);
14608  if (__pyx_t_1) {
14609 
14610  /* "View.MemoryView":755
14611  * False)
14612  * elif index is None:
14613  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
14614  * p_dst.strides[new_ndim] = 0
14615  * p_dst.suboffsets[new_ndim] = -1
14616  */
14617  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
14618 
14619  /* "View.MemoryView":756
14620  * elif index is None:
14621  * p_dst.shape[new_ndim] = 1
14622  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
14623  * p_dst.suboffsets[new_ndim] = -1
14624  * new_ndim += 1
14625  */
14626  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
14627 
14628  /* "View.MemoryView":757
14629  * p_dst.shape[new_ndim] = 1
14630  * p_dst.strides[new_ndim] = 0
14631  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
14632  * new_ndim += 1
14633  * else:
14634  */
14635  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
14636 
14637  /* "View.MemoryView":758
14638  * p_dst.strides[new_ndim] = 0
14639  * p_dst.suboffsets[new_ndim] = -1
14640  * new_ndim += 1 # <<<<<<<<<<<<<<
14641  * else:
14642  * start = index.start or 0
14643  */
14644  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14645 
14646  /* "View.MemoryView":754
14647  * 0, 0, 0, # have_{start,stop,step}
14648  * False)
14649  * elif index is None: # <<<<<<<<<<<<<<
14650  * p_dst.shape[new_ndim] = 1
14651  * p_dst.strides[new_ndim] = 0
14652  */
14653  goto __pyx_L6;
14654  }
14655 
14656  /* "View.MemoryView":760
14657  * new_ndim += 1
14658  * else:
14659  * start = index.start or 0 # <<<<<<<<<<<<<<
14660  * stop = index.stop or 0
14661  * step = index.step or 0
14662  */
14663  /*else*/ {
14664  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
14665  __Pyx_GOTREF(__pyx_t_9);
14666  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
14667  if (!__pyx_t_1) {
14668  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14669  } else {
14670  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
14671  __pyx_t_10 = __pyx_t_12;
14672  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14673  goto __pyx_L7_bool_binop_done;
14674  }
14675  __pyx_t_10 = 0;
14676  __pyx_L7_bool_binop_done:;
14677  __pyx_v_start = __pyx_t_10;
14678 
14679  /* "View.MemoryView":761
14680  * else:
14681  * start = index.start or 0
14682  * stop = index.stop or 0 # <<<<<<<<<<<<<<
14683  * step = index.step or 0
14684  *
14685  */
14686  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
14687  __Pyx_GOTREF(__pyx_t_9);
14688  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
14689  if (!__pyx_t_1) {
14690  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14691  } else {
14692  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
14693  __pyx_t_10 = __pyx_t_12;
14694  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14695  goto __pyx_L9_bool_binop_done;
14696  }
14697  __pyx_t_10 = 0;
14698  __pyx_L9_bool_binop_done:;
14699  __pyx_v_stop = __pyx_t_10;
14700 
14701  /* "View.MemoryView":762
14702  * start = index.start or 0
14703  * stop = index.stop or 0
14704  * step = index.step or 0 # <<<<<<<<<<<<<<
14705  *
14706  * have_start = index.start is not None
14707  */
14708  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
14709  __Pyx_GOTREF(__pyx_t_9);
14710  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
14711  if (!__pyx_t_1) {
14712  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14713  } else {
14714  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
14715  __pyx_t_10 = __pyx_t_12;
14716  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14717  goto __pyx_L11_bool_binop_done;
14718  }
14719  __pyx_t_10 = 0;
14720  __pyx_L11_bool_binop_done:;
14721  __pyx_v_step = __pyx_t_10;
14722 
14723  /* "View.MemoryView":764
14724  * step = index.step or 0
14725  *
14726  * have_start = index.start is not None # <<<<<<<<<<<<<<
14727  * have_stop = index.stop is not None
14728  * have_step = index.step is not None
14729  */
14730  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
14731  __Pyx_GOTREF(__pyx_t_9);
14732  __pyx_t_1 = (__pyx_t_9 != Py_None);
14733  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14734  __pyx_v_have_start = __pyx_t_1;
14735 
14736  /* "View.MemoryView":765
14737  *
14738  * have_start = index.start is not None
14739  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
14740  * have_step = index.step is not None
14741  *
14742  */
14743  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
14744  __Pyx_GOTREF(__pyx_t_9);
14745  __pyx_t_1 = (__pyx_t_9 != Py_None);
14746  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14747  __pyx_v_have_stop = __pyx_t_1;
14748 
14749  /* "View.MemoryView":766
14750  * have_start = index.start is not None
14751  * have_stop = index.stop is not None
14752  * have_step = index.step is not None # <<<<<<<<<<<<<<
14753  *
14754  * slice_memviewslice(
14755  */
14756  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
14757  __Pyx_GOTREF(__pyx_t_9);
14758  __pyx_t_1 = (__pyx_t_9 != Py_None);
14759  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14760  __pyx_v_have_step = __pyx_t_1;
14761 
14762  /* "View.MemoryView":768
14763  * have_step = index.step is not None
14764  *
14765  * slice_memviewslice( # <<<<<<<<<<<<<<
14766  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14767  * dim, new_ndim, p_suboffset_dim,
14768  */
14769  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
14770 
14771  /* "View.MemoryView":774
14772  * have_start, have_stop, have_step,
14773  * True)
14774  * new_ndim += 1 # <<<<<<<<<<<<<<
14775  *
14776  * if isinstance(memview, _memoryviewslice):
14777  */
14778  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14779  }
14780  __pyx_L6:;
14781 
14782  /* "View.MemoryView":746
14783  * cdef bint have_start, have_stop, have_step
14784  *
14785  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14786  * if PyIndex_Check(index):
14787  * slice_memviewslice(
14788  */
14789  }
14790  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14791 
14792  /* "View.MemoryView":776
14793  * new_ndim += 1
14794  *
14795  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14796  * return memoryview_fromslice(dst, new_ndim,
14797  * memviewsliceobj.to_object_func,
14798  */
14799  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14800  __pyx_t_2 = (__pyx_t_1 != 0);
14801  if (__pyx_t_2) {
14802 
14803  /* "View.MemoryView":777
14804  *
14805  * if isinstance(memview, _memoryviewslice):
14806  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14807  * memviewsliceobj.to_object_func,
14808  * memviewsliceobj.to_dtype_func,
14809  */
14810  __Pyx_XDECREF(((PyObject *)__pyx_r));
14811 
14812  /* "View.MemoryView":778
14813  * if isinstance(memview, _memoryviewslice):
14814  * return memoryview_fromslice(dst, new_ndim,
14815  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
14816  * memviewsliceobj.to_dtype_func,
14817  * memview.dtype_is_object)
14818  */
14819  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
14820 
14821  /* "View.MemoryView":779
14822  * return memoryview_fromslice(dst, new_ndim,
14823  * memviewsliceobj.to_object_func,
14824  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
14825  * memview.dtype_is_object)
14826  * else:
14827  */
14828  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
14829 
14830  /* "View.MemoryView":777
14831  *
14832  * if isinstance(memview, _memoryviewslice):
14833  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14834  * memviewsliceobj.to_object_func,
14835  * memviewsliceobj.to_dtype_func,
14836  */
14837  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
14838  __Pyx_GOTREF(__pyx_t_3);
14839  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
14840  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
14841  __pyx_t_3 = 0;
14842  goto __pyx_L0;
14843 
14844  /* "View.MemoryView":776
14845  * new_ndim += 1
14846  *
14847  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14848  * return memoryview_fromslice(dst, new_ndim,
14849  * memviewsliceobj.to_object_func,
14850  */
14851  }
14852 
14853  /* "View.MemoryView":782
14854  * memview.dtype_is_object)
14855  * else:
14856  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14857  * memview.dtype_is_object)
14858  *
14859  */
14860  /*else*/ {
14861  __Pyx_XDECREF(((PyObject *)__pyx_r));
14862 
14863  /* "View.MemoryView":783
14864  * else:
14865  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
14866  * memview.dtype_is_object) # <<<<<<<<<<<<<<
14867  *
14868  *
14869  */
14870  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
14871  __Pyx_GOTREF(__pyx_t_3);
14872 
14873  /* "View.MemoryView":782
14874  * memview.dtype_is_object)
14875  * else:
14876  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14877  * memview.dtype_is_object)
14878  *
14879  */
14880  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
14881  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
14882  __pyx_t_3 = 0;
14883  goto __pyx_L0;
14884  }
14885 
14886  /* "View.MemoryView":710
14887  *
14888  * @cname('__pyx_memview_slice')
14889  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14890  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14891  * cdef bint negative_step
14892  */
14893 
14894  /* function exit code */
14895  __pyx_L1_error:;
14896  __Pyx_XDECREF(__pyx_t_3);
14897  __Pyx_XDECREF(__pyx_t_9);
14898  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14899  __pyx_r = 0;
14900  __pyx_L0:;
14901  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14902  __Pyx_XDECREF(__pyx_v_index);
14903  __Pyx_XGIVEREF((PyObject *)__pyx_r);
14904  __Pyx_RefNannyFinishContext();
14905  return __pyx_r;
14906 }
14907 
14908 /* "View.MemoryView":807
14909  *
14910  * @cname('__pyx_memoryview_slice_memviewslice')
14911  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
14912  * __Pyx_memviewslice *dst,
14913  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14914  */
14915 
14916 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
14917  Py_ssize_t __pyx_v_new_shape;
14918  int __pyx_v_negative_step;
14919  int __pyx_r;
14920  int __pyx_t_1;
14921  int __pyx_t_2;
14922  int __pyx_t_3;
14923  int __pyx_lineno = 0;
14924  const char *__pyx_filename = NULL;
14925  int __pyx_clineno = 0;
14926 
14927  /* "View.MemoryView":827
14928  * cdef bint negative_step
14929  *
14930  * if not is_slice: # <<<<<<<<<<<<<<
14931  *
14932  * if start < 0:
14933  */
14934  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
14935  if (__pyx_t_1) {
14936 
14937  /* "View.MemoryView":829
14938  * if not is_slice:
14939  *
14940  * if start < 0: # <<<<<<<<<<<<<<
14941  * start += shape
14942  * if not 0 <= start < shape:
14943  */
14944  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
14945  if (__pyx_t_1) {
14946 
14947  /* "View.MemoryView":830
14948  *
14949  * if start < 0:
14950  * start += shape # <<<<<<<<<<<<<<
14951  * if not 0 <= start < shape:
14952  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14953  */
14954  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14955 
14956  /* "View.MemoryView":829
14957  * if not is_slice:
14958  *
14959  * if start < 0: # <<<<<<<<<<<<<<
14960  * start += shape
14961  * if not 0 <= start < shape:
14962  */
14963  }
14964 
14965  /* "View.MemoryView":831
14966  * if start < 0:
14967  * start += shape
14968  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14969  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14970  * else:
14971  */
14972  __pyx_t_1 = (0 <= __pyx_v_start);
14973  if (__pyx_t_1) {
14974  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
14975  }
14976  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14977  if (__pyx_t_2) {
14978 
14979  /* "View.MemoryView":832
14980  * start += shape
14981  * if not 0 <= start < shape:
14982  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
14983  * else:
14984  *
14985  */
14986  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
14987 
14988  /* "View.MemoryView":831
14989  * if start < 0:
14990  * start += shape
14991  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14992  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14993  * else:
14994  */
14995  }
14996 
14997  /* "View.MemoryView":827
14998  * cdef bint negative_step
14999  *
15000  * if not is_slice: # <<<<<<<<<<<<<<
15001  *
15002  * if start < 0:
15003  */
15004  goto __pyx_L3;
15005  }
15006 
15007  /* "View.MemoryView":835
15008  * else:
15009  *
15010  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
15011  *
15012  * if have_step and step == 0:
15013  */
15014  /*else*/ {
15015  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15016  if (__pyx_t_1) {
15017  } else {
15018  __pyx_t_2 = __pyx_t_1;
15019  goto __pyx_L6_bool_binop_done;
15020  }
15021  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15022  __pyx_t_2 = __pyx_t_1;
15023  __pyx_L6_bool_binop_done:;
15024  __pyx_v_negative_step = __pyx_t_2;
15025 
15026  /* "View.MemoryView":837
15027  * negative_step = have_step != 0 and step < 0
15028  *
15029  * if have_step and step == 0: # <<<<<<<<<<<<<<
15030  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15031  *
15032  */
15033  __pyx_t_1 = (__pyx_v_have_step != 0);
15034  if (__pyx_t_1) {
15035  } else {
15036  __pyx_t_2 = __pyx_t_1;
15037  goto __pyx_L9_bool_binop_done;
15038  }
15039  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15040  __pyx_t_2 = __pyx_t_1;
15041  __pyx_L9_bool_binop_done:;
15042  if (__pyx_t_2) {
15043 
15044  /* "View.MemoryView":838
15045  *
15046  * if have_step and step == 0:
15047  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
15048  *
15049  *
15050  */
15051  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
15052 
15053  /* "View.MemoryView":837
15054  * negative_step = have_step != 0 and step < 0
15055  *
15056  * if have_step and step == 0: # <<<<<<<<<<<<<<
15057  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15058  *
15059  */
15060  }
15061 
15062  /* "View.MemoryView":841
15063  *
15064  *
15065  * if have_start: # <<<<<<<<<<<<<<
15066  * if start < 0:
15067  * start += shape
15068  */
15069  __pyx_t_2 = (__pyx_v_have_start != 0);
15070  if (__pyx_t_2) {
15071 
15072  /* "View.MemoryView":842
15073  *
15074  * if have_start:
15075  * if start < 0: # <<<<<<<<<<<<<<
15076  * start += shape
15077  * if start < 0:
15078  */
15079  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15080  if (__pyx_t_2) {
15081 
15082  /* "View.MemoryView":843
15083  * if have_start:
15084  * if start < 0:
15085  * start += shape # <<<<<<<<<<<<<<
15086  * if start < 0:
15087  * start = 0
15088  */
15089  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15090 
15091  /* "View.MemoryView":844
15092  * if start < 0:
15093  * start += shape
15094  * if start < 0: # <<<<<<<<<<<<<<
15095  * start = 0
15096  * elif start >= shape:
15097  */
15098  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15099  if (__pyx_t_2) {
15100 
15101  /* "View.MemoryView":845
15102  * start += shape
15103  * if start < 0:
15104  * start = 0 # <<<<<<<<<<<<<<
15105  * elif start >= shape:
15106  * if negative_step:
15107  */
15108  __pyx_v_start = 0;
15109 
15110  /* "View.MemoryView":844
15111  * if start < 0:
15112  * start += shape
15113  * if start < 0: # <<<<<<<<<<<<<<
15114  * start = 0
15115  * elif start >= shape:
15116  */
15117  }
15118 
15119  /* "View.MemoryView":842
15120  *
15121  * if have_start:
15122  * if start < 0: # <<<<<<<<<<<<<<
15123  * start += shape
15124  * if start < 0:
15125  */
15126  goto __pyx_L12;
15127  }
15128 
15129  /* "View.MemoryView":846
15130  * if start < 0:
15131  * start = 0
15132  * elif start >= shape: # <<<<<<<<<<<<<<
15133  * if negative_step:
15134  * start = shape - 1
15135  */
15136  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15137  if (__pyx_t_2) {
15138 
15139  /* "View.MemoryView":847
15140  * start = 0
15141  * elif start >= shape:
15142  * if negative_step: # <<<<<<<<<<<<<<
15143  * start = shape - 1
15144  * else:
15145  */
15146  __pyx_t_2 = (__pyx_v_negative_step != 0);
15147  if (__pyx_t_2) {
15148 
15149  /* "View.MemoryView":848
15150  * elif start >= shape:
15151  * if negative_step:
15152  * start = shape - 1 # <<<<<<<<<<<<<<
15153  * else:
15154  * start = shape
15155  */
15156  __pyx_v_start = (__pyx_v_shape - 1);
15157 
15158  /* "View.MemoryView":847
15159  * start = 0
15160  * elif start >= shape:
15161  * if negative_step: # <<<<<<<<<<<<<<
15162  * start = shape - 1
15163  * else:
15164  */
15165  goto __pyx_L14;
15166  }
15167 
15168  /* "View.MemoryView":850
15169  * start = shape - 1
15170  * else:
15171  * start = shape # <<<<<<<<<<<<<<
15172  * else:
15173  * if negative_step:
15174  */
15175  /*else*/ {
15176  __pyx_v_start = __pyx_v_shape;
15177  }
15178  __pyx_L14:;
15179 
15180  /* "View.MemoryView":846
15181  * if start < 0:
15182  * start = 0
15183  * elif start >= shape: # <<<<<<<<<<<<<<
15184  * if negative_step:
15185  * start = shape - 1
15186  */
15187  }
15188  __pyx_L12:;
15189 
15190  /* "View.MemoryView":841
15191  *
15192  *
15193  * if have_start: # <<<<<<<<<<<<<<
15194  * if start < 0:
15195  * start += shape
15196  */
15197  goto __pyx_L11;
15198  }
15199 
15200  /* "View.MemoryView":852
15201  * start = shape
15202  * else:
15203  * if negative_step: # <<<<<<<<<<<<<<
15204  * start = shape - 1
15205  * else:
15206  */
15207  /*else*/ {
15208  __pyx_t_2 = (__pyx_v_negative_step != 0);
15209  if (__pyx_t_2) {
15210 
15211  /* "View.MemoryView":853
15212  * else:
15213  * if negative_step:
15214  * start = shape - 1 # <<<<<<<<<<<<<<
15215  * else:
15216  * start = 0
15217  */
15218  __pyx_v_start = (__pyx_v_shape - 1);
15219 
15220  /* "View.MemoryView":852
15221  * start = shape
15222  * else:
15223  * if negative_step: # <<<<<<<<<<<<<<
15224  * start = shape - 1
15225  * else:
15226  */
15227  goto __pyx_L15;
15228  }
15229 
15230  /* "View.MemoryView":855
15231  * start = shape - 1
15232  * else:
15233  * start = 0 # <<<<<<<<<<<<<<
15234  *
15235  * if have_stop:
15236  */
15237  /*else*/ {
15238  __pyx_v_start = 0;
15239  }
15240  __pyx_L15:;
15241  }
15242  __pyx_L11:;
15243 
15244  /* "View.MemoryView":857
15245  * start = 0
15246  *
15247  * if have_stop: # <<<<<<<<<<<<<<
15248  * if stop < 0:
15249  * stop += shape
15250  */
15251  __pyx_t_2 = (__pyx_v_have_stop != 0);
15252  if (__pyx_t_2) {
15253 
15254  /* "View.MemoryView":858
15255  *
15256  * if have_stop:
15257  * if stop < 0: # <<<<<<<<<<<<<<
15258  * stop += shape
15259  * if stop < 0:
15260  */
15261  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15262  if (__pyx_t_2) {
15263 
15264  /* "View.MemoryView":859
15265  * if have_stop:
15266  * if stop < 0:
15267  * stop += shape # <<<<<<<<<<<<<<
15268  * if stop < 0:
15269  * stop = 0
15270  */
15271  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15272 
15273  /* "View.MemoryView":860
15274  * if stop < 0:
15275  * stop += shape
15276  * if stop < 0: # <<<<<<<<<<<<<<
15277  * stop = 0
15278  * elif stop > shape:
15279  */
15280  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15281  if (__pyx_t_2) {
15282 
15283  /* "View.MemoryView":861
15284  * stop += shape
15285  * if stop < 0:
15286  * stop = 0 # <<<<<<<<<<<<<<
15287  * elif stop > shape:
15288  * stop = shape
15289  */
15290  __pyx_v_stop = 0;
15291 
15292  /* "View.MemoryView":860
15293  * if stop < 0:
15294  * stop += shape
15295  * if stop < 0: # <<<<<<<<<<<<<<
15296  * stop = 0
15297  * elif stop > shape:
15298  */
15299  }
15300 
15301  /* "View.MemoryView":858
15302  *
15303  * if have_stop:
15304  * if stop < 0: # <<<<<<<<<<<<<<
15305  * stop += shape
15306  * if stop < 0:
15307  */
15308  goto __pyx_L17;
15309  }
15310 
15311  /* "View.MemoryView":862
15312  * if stop < 0:
15313  * stop = 0
15314  * elif stop > shape: # <<<<<<<<<<<<<<
15315  * stop = shape
15316  * else:
15317  */
15318  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15319  if (__pyx_t_2) {
15320 
15321  /* "View.MemoryView":863
15322  * stop = 0
15323  * elif stop > shape:
15324  * stop = shape # <<<<<<<<<<<<<<
15325  * else:
15326  * if negative_step:
15327  */
15328  __pyx_v_stop = __pyx_v_shape;
15329 
15330  /* "View.MemoryView":862
15331  * if stop < 0:
15332  * stop = 0
15333  * elif stop > shape: # <<<<<<<<<<<<<<
15334  * stop = shape
15335  * else:
15336  */
15337  }
15338  __pyx_L17:;
15339 
15340  /* "View.MemoryView":857
15341  * start = 0
15342  *
15343  * if have_stop: # <<<<<<<<<<<<<<
15344  * if stop < 0:
15345  * stop += shape
15346  */
15347  goto __pyx_L16;
15348  }
15349 
15350  /* "View.MemoryView":865
15351  * stop = shape
15352  * else:
15353  * if negative_step: # <<<<<<<<<<<<<<
15354  * stop = -1
15355  * else:
15356  */
15357  /*else*/ {
15358  __pyx_t_2 = (__pyx_v_negative_step != 0);
15359  if (__pyx_t_2) {
15360 
15361  /* "View.MemoryView":866
15362  * else:
15363  * if negative_step:
15364  * stop = -1 # <<<<<<<<<<<<<<
15365  * else:
15366  * stop = shape
15367  */
15368  __pyx_v_stop = -1L;
15369 
15370  /* "View.MemoryView":865
15371  * stop = shape
15372  * else:
15373  * if negative_step: # <<<<<<<<<<<<<<
15374  * stop = -1
15375  * else:
15376  */
15377  goto __pyx_L19;
15378  }
15379 
15380  /* "View.MemoryView":868
15381  * stop = -1
15382  * else:
15383  * stop = shape # <<<<<<<<<<<<<<
15384  *
15385  * if not have_step:
15386  */
15387  /*else*/ {
15388  __pyx_v_stop = __pyx_v_shape;
15389  }
15390  __pyx_L19:;
15391  }
15392  __pyx_L16:;
15393 
15394  /* "View.MemoryView":870
15395  * stop = shape
15396  *
15397  * if not have_step: # <<<<<<<<<<<<<<
15398  * step = 1
15399  *
15400  */
15401  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15402  if (__pyx_t_2) {
15403 
15404  /* "View.MemoryView":871
15405  *
15406  * if not have_step:
15407  * step = 1 # <<<<<<<<<<<<<<
15408  *
15409  *
15410  */
15411  __pyx_v_step = 1;
15412 
15413  /* "View.MemoryView":870
15414  * stop = shape
15415  *
15416  * if not have_step: # <<<<<<<<<<<<<<
15417  * step = 1
15418  *
15419  */
15420  }
15421 
15422  /* "View.MemoryView":875
15423  *
15424  * with cython.cdivision(True):
15425  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
15426  *
15427  * if (stop - start) - step * new_shape:
15428  */
15429  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15430 
15431  /* "View.MemoryView":877
15432  * new_shape = (stop - start) // step
15433  *
15434  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15435  * new_shape += 1
15436  *
15437  */
15438  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15439  if (__pyx_t_2) {
15440 
15441  /* "View.MemoryView":878
15442  *
15443  * if (stop - start) - step * new_shape:
15444  * new_shape += 1 # <<<<<<<<<<<<<<
15445  *
15446  * if new_shape < 0:
15447  */
15448  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15449 
15450  /* "View.MemoryView":877
15451  * new_shape = (stop - start) // step
15452  *
15453  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15454  * new_shape += 1
15455  *
15456  */
15457  }
15458 
15459  /* "View.MemoryView":880
15460  * new_shape += 1
15461  *
15462  * if new_shape < 0: # <<<<<<<<<<<<<<
15463  * new_shape = 0
15464  *
15465  */
15466  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
15467  if (__pyx_t_2) {
15468 
15469  /* "View.MemoryView":881
15470  *
15471  * if new_shape < 0:
15472  * new_shape = 0 # <<<<<<<<<<<<<<
15473  *
15474  *
15475  */
15476  __pyx_v_new_shape = 0;
15477 
15478  /* "View.MemoryView":880
15479  * new_shape += 1
15480  *
15481  * if new_shape < 0: # <<<<<<<<<<<<<<
15482  * new_shape = 0
15483  *
15484  */
15485  }
15486 
15487  /* "View.MemoryView":884
15488  *
15489  *
15490  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
15491  * dst.shape[new_ndim] = new_shape
15492  * dst.suboffsets[new_ndim] = suboffset
15493  */
15494  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
15495 
15496  /* "View.MemoryView":885
15497  *
15498  * dst.strides[new_ndim] = stride * step
15499  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
15500  * dst.suboffsets[new_ndim] = suboffset
15501  *
15502  */
15503  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
15504 
15505  /* "View.MemoryView":886
15506  * dst.strides[new_ndim] = stride * step
15507  * dst.shape[new_ndim] = new_shape
15508  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
15509  *
15510  *
15511  */
15512  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
15513  }
15514  __pyx_L3:;
15515 
15516  /* "View.MemoryView":889
15517  *
15518  *
15519  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15520  * dst.data += start * stride
15521  * else:
15522  */
15523  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
15524  if (__pyx_t_2) {
15525 
15526  /* "View.MemoryView":890
15527  *
15528  * if suboffset_dim[0] < 0:
15529  * dst.data += start * stride # <<<<<<<<<<<<<<
15530  * else:
15531  * dst.suboffsets[suboffset_dim[0]] += start * stride
15532  */
15533  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
15534 
15535  /* "View.MemoryView":889
15536  *
15537  *
15538  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15539  * dst.data += start * stride
15540  * else:
15541  */
15542  goto __pyx_L23;
15543  }
15544 
15545  /* "View.MemoryView":892
15546  * dst.data += start * stride
15547  * else:
15548  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
15549  *
15550  * if suboffset >= 0:
15551  */
15552  /*else*/ {
15553  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
15554  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
15555  }
15556  __pyx_L23:;
15557 
15558  /* "View.MemoryView":894
15559  * dst.suboffsets[suboffset_dim[0]] += start * stride
15560  *
15561  * if suboffset >= 0: # <<<<<<<<<<<<<<
15562  * if not is_slice:
15563  * if new_ndim == 0:
15564  */
15565  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15566  if (__pyx_t_2) {
15567 
15568  /* "View.MemoryView":895
15569  *
15570  * if suboffset >= 0:
15571  * if not is_slice: # <<<<<<<<<<<<<<
15572  * if new_ndim == 0:
15573  * dst.data = (<char **> dst.data)[0] + suboffset
15574  */
15575  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
15576  if (__pyx_t_2) {
15577 
15578  /* "View.MemoryView":896
15579  * if suboffset >= 0:
15580  * if not is_slice:
15581  * if new_ndim == 0: # <<<<<<<<<<<<<<
15582  * dst.data = (<char **> dst.data)[0] + suboffset
15583  * else:
15584  */
15585  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
15586  if (__pyx_t_2) {
15587 
15588  /* "View.MemoryView":897
15589  * if not is_slice:
15590  * if new_ndim == 0:
15591  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
15592  * else:
15593  * _err_dim(IndexError, "All dimensions preceding dimension %d "
15594  */
15595  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
15596 
15597  /* "View.MemoryView":896
15598  * if suboffset >= 0:
15599  * if not is_slice:
15600  * if new_ndim == 0: # <<<<<<<<<<<<<<
15601  * dst.data = (<char **> dst.data)[0] + suboffset
15602  * else:
15603  */
15604  goto __pyx_L26;
15605  }
15606 
15607  /* "View.MemoryView":899
15608  * dst.data = (<char **> dst.data)[0] + suboffset
15609  * else:
15610  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
15611  * "must be indexed and not sliced", dim)
15612  * else:
15613  */
15614  /*else*/ {
15615 
15616  /* "View.MemoryView":900
15617  * else:
15618  * _err_dim(IndexError, "All dimensions preceding dimension %d "
15619  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
15620  * else:
15621  * suboffset_dim[0] = new_ndim
15622  */
15623  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
15624  }
15625  __pyx_L26:;
15626 
15627  /* "View.MemoryView":895
15628  *
15629  * if suboffset >= 0:
15630  * if not is_slice: # <<<<<<<<<<<<<<
15631  * if new_ndim == 0:
15632  * dst.data = (<char **> dst.data)[0] + suboffset
15633  */
15634  goto __pyx_L25;
15635  }
15636 
15637  /* "View.MemoryView":902
15638  * "must be indexed and not sliced", dim)
15639  * else:
15640  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
15641  *
15642  * return 0
15643  */
15644  /*else*/ {
15645  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
15646  }
15647  __pyx_L25:;
15648 
15649  /* "View.MemoryView":894
15650  * dst.suboffsets[suboffset_dim[0]] += start * stride
15651  *
15652  * if suboffset >= 0: # <<<<<<<<<<<<<<
15653  * if not is_slice:
15654  * if new_ndim == 0:
15655  */
15656  }
15657 
15658  /* "View.MemoryView":904
15659  * suboffset_dim[0] = new_ndim
15660  *
15661  * return 0 # <<<<<<<<<<<<<<
15662  *
15663  *
15664  */
15665  __pyx_r = 0;
15666  goto __pyx_L0;
15667 
15668  /* "View.MemoryView":807
15669  *
15670  * @cname('__pyx_memoryview_slice_memviewslice')
15671  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15672  * __Pyx_memviewslice *dst,
15673  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15674  */
15675 
15676  /* function exit code */
15677  __pyx_L1_error:;
15678  {
15679  #ifdef WITH_THREAD
15680  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15681  #endif
15682  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15683  #ifdef WITH_THREAD
15684  __Pyx_PyGILState_Release(__pyx_gilstate_save);
15685  #endif
15686  }
15687  __pyx_r = -1;
15688  __pyx_L0:;
15689  return __pyx_r;
15690 }
15691 
15692 /* "View.MemoryView":910
15693  *
15694  * @cname('__pyx_pybuffer_index')
15695  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
15696  * Py_ssize_t dim) except NULL:
15697  * cdef Py_ssize_t shape, stride, suboffset = -1
15698  */
15699 
15700 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
15701  Py_ssize_t __pyx_v_shape;
15702  Py_ssize_t __pyx_v_stride;
15703  Py_ssize_t __pyx_v_suboffset;
15704  Py_ssize_t __pyx_v_itemsize;
15705  char *__pyx_v_resultp;
15706  char *__pyx_r;
15707  __Pyx_RefNannyDeclarations
15708  Py_ssize_t __pyx_t_1;
15709  int __pyx_t_2;
15710  PyObject *__pyx_t_3 = NULL;
15711  PyObject *__pyx_t_4 = NULL;
15712  int __pyx_lineno = 0;
15713  const char *__pyx_filename = NULL;
15714  int __pyx_clineno = 0;
15715  __Pyx_RefNannySetupContext("pybuffer_index", 0);
15716 
15717  /* "View.MemoryView":912
15718  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
15719  * Py_ssize_t dim) except NULL:
15720  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
15721  * cdef Py_ssize_t itemsize = view.itemsize
15722  * cdef char *resultp
15723  */
15724  __pyx_v_suboffset = -1L;
15725 
15726  /* "View.MemoryView":913
15727  * Py_ssize_t dim) except NULL:
15728  * cdef Py_ssize_t shape, stride, suboffset = -1
15729  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
15730  * cdef char *resultp
15731  *
15732  */
15733  __pyx_t_1 = __pyx_v_view->itemsize;
15734  __pyx_v_itemsize = __pyx_t_1;
15735 
15736  /* "View.MemoryView":916
15737  * cdef char *resultp
15738  *
15739  * if view.ndim == 0: # <<<<<<<<<<<<<<
15740  * shape = view.len / itemsize
15741  * stride = itemsize
15742  */
15743  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
15744  if (__pyx_t_2) {
15745 
15746  /* "View.MemoryView":917
15747  *
15748  * if view.ndim == 0:
15749  * shape = view.len / itemsize # <<<<<<<<<<<<<<
15750  * stride = itemsize
15751  * else:
15752  */
15753  if (unlikely(__pyx_v_itemsize == 0)) {
15754  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
15755  __PYX_ERR(1, 917, __pyx_L1_error)
15756  }
15757  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
15758  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
15759  __PYX_ERR(1, 917, __pyx_L1_error)
15760  }
15761  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
15762 
15763  /* "View.MemoryView":918
15764  * if view.ndim == 0:
15765  * shape = view.len / itemsize
15766  * stride = itemsize # <<<<<<<<<<<<<<
15767  * else:
15768  * shape = view.shape[dim]
15769  */
15770  __pyx_v_stride = __pyx_v_itemsize;
15771 
15772  /* "View.MemoryView":916
15773  * cdef char *resultp
15774  *
15775  * if view.ndim == 0: # <<<<<<<<<<<<<<
15776  * shape = view.len / itemsize
15777  * stride = itemsize
15778  */
15779  goto __pyx_L3;
15780  }
15781 
15782  /* "View.MemoryView":920
15783  * stride = itemsize
15784  * else:
15785  * shape = view.shape[dim] # <<<<<<<<<<<<<<
15786  * stride = view.strides[dim]
15787  * if view.suboffsets != NULL:
15788  */
15789  /*else*/ {
15790  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
15791 
15792  /* "View.MemoryView":921
15793  * else:
15794  * shape = view.shape[dim]
15795  * stride = view.strides[dim] # <<<<<<<<<<<<<<
15796  * if view.suboffsets != NULL:
15797  * suboffset = view.suboffsets[dim]
15798  */
15799  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
15800 
15801  /* "View.MemoryView":922
15802  * shape = view.shape[dim]
15803  * stride = view.strides[dim]
15804  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
15805  * suboffset = view.suboffsets[dim]
15806  *
15807  */
15808  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
15809  if (__pyx_t_2) {
15810 
15811  /* "View.MemoryView":923
15812  * stride = view.strides[dim]
15813  * if view.suboffsets != NULL:
15814  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
15815  *
15816  * if index < 0:
15817  */
15818  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
15819 
15820  /* "View.MemoryView":922
15821  * shape = view.shape[dim]
15822  * stride = view.strides[dim]
15823  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
15824  * suboffset = view.suboffsets[dim]
15825  *
15826  */
15827  }
15828  }
15829  __pyx_L3:;
15830 
15831  /* "View.MemoryView":925
15832  * suboffset = view.suboffsets[dim]
15833  *
15834  * if index < 0: # <<<<<<<<<<<<<<
15835  * index += view.shape[dim]
15836  * if index < 0:
15837  */
15838  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15839  if (__pyx_t_2) {
15840 
15841  /* "View.MemoryView":926
15842  *
15843  * if index < 0:
15844  * index += view.shape[dim] # <<<<<<<<<<<<<<
15845  * if index < 0:
15846  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15847  */
15848  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
15849 
15850  /* "View.MemoryView":927
15851  * if index < 0:
15852  * index += view.shape[dim]
15853  * if index < 0: # <<<<<<<<<<<<<<
15854  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15855  *
15856  */
15857  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15858  if (unlikely(__pyx_t_2)) {
15859 
15860  /* "View.MemoryView":928
15861  * index += view.shape[dim]
15862  * if index < 0:
15863  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
15864  *
15865  * if index >= shape:
15866  */
15867  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
15868  __Pyx_GOTREF(__pyx_t_3);
15869  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
15870  __Pyx_GOTREF(__pyx_t_4);
15871  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15872  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
15873  __Pyx_GOTREF(__pyx_t_3);
15874  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15875  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15876  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15877  __PYX_ERR(1, 928, __pyx_L1_error)
15878 
15879  /* "View.MemoryView":927
15880  * if index < 0:
15881  * index += view.shape[dim]
15882  * if index < 0: # <<<<<<<<<<<<<<
15883  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15884  *
15885  */
15886  }
15887 
15888  /* "View.MemoryView":925
15889  * suboffset = view.suboffsets[dim]
15890  *
15891  * if index < 0: # <<<<<<<<<<<<<<
15892  * index += view.shape[dim]
15893  * if index < 0:
15894  */
15895  }
15896 
15897  /* "View.MemoryView":930
15898  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15899  *
15900  * if index >= shape: # <<<<<<<<<<<<<<
15901  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15902  *
15903  */
15904  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
15905  if (unlikely(__pyx_t_2)) {
15906 
15907  /* "View.MemoryView":931
15908  *
15909  * if index >= shape:
15910  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
15911  *
15912  * resultp = bufp + index * stride
15913  */
15914  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
15915  __Pyx_GOTREF(__pyx_t_3);
15916  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
15917  __Pyx_GOTREF(__pyx_t_4);
15918  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15919  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
15920  __Pyx_GOTREF(__pyx_t_3);
15921  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15922  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15923  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15924  __PYX_ERR(1, 931, __pyx_L1_error)
15925 
15926  /* "View.MemoryView":930
15927  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15928  *
15929  * if index >= shape: # <<<<<<<<<<<<<<
15930  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15931  *
15932  */
15933  }
15934 
15935  /* "View.MemoryView":933
15936  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15937  *
15938  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
15939  * if suboffset >= 0:
15940  * resultp = (<char **> resultp)[0] + suboffset
15941  */
15942  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
15943 
15944  /* "View.MemoryView":934
15945  *
15946  * resultp = bufp + index * stride
15947  * if suboffset >= 0: # <<<<<<<<<<<<<<
15948  * resultp = (<char **> resultp)[0] + suboffset
15949  *
15950  */
15951  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15952  if (__pyx_t_2) {
15953 
15954  /* "View.MemoryView":935
15955  * resultp = bufp + index * stride
15956  * if suboffset >= 0:
15957  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
15958  *
15959  * return resultp
15960  */
15961  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
15962 
15963  /* "View.MemoryView":934
15964  *
15965  * resultp = bufp + index * stride
15966  * if suboffset >= 0: # <<<<<<<<<<<<<<
15967  * resultp = (<char **> resultp)[0] + suboffset
15968  *
15969  */
15970  }
15971 
15972  /* "View.MemoryView":937
15973  * resultp = (<char **> resultp)[0] + suboffset
15974  *
15975  * return resultp # <<<<<<<<<<<<<<
15976  *
15977  *
15978  */
15979  __pyx_r = __pyx_v_resultp;
15980  goto __pyx_L0;
15981 
15982  /* "View.MemoryView":910
15983  *
15984  * @cname('__pyx_pybuffer_index')
15985  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
15986  * Py_ssize_t dim) except NULL:
15987  * cdef Py_ssize_t shape, stride, suboffset = -1
15988  */
15989 
15990  /* function exit code */
15991  __pyx_L1_error:;
15992  __Pyx_XDECREF(__pyx_t_3);
15993  __Pyx_XDECREF(__pyx_t_4);
15994  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
15995  __pyx_r = NULL;
15996  __pyx_L0:;
15997  __Pyx_RefNannyFinishContext();
15998  return __pyx_r;
15999 }
16000 
16001 /* "View.MemoryView":943
16002  *
16003  * @cname('__pyx_memslice_transpose')
16004  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16005  * cdef int ndim = memslice.memview.view.ndim
16006  *
16007  */
16008 
16009 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16010  int __pyx_v_ndim;
16011  Py_ssize_t *__pyx_v_shape;
16012  Py_ssize_t *__pyx_v_strides;
16013  int __pyx_v_i;
16014  int __pyx_v_j;
16015  int __pyx_r;
16016  int __pyx_t_1;
16017  Py_ssize_t *__pyx_t_2;
16018  long __pyx_t_3;
16019  long __pyx_t_4;
16020  Py_ssize_t __pyx_t_5;
16021  Py_ssize_t __pyx_t_6;
16022  int __pyx_t_7;
16023  int __pyx_t_8;
16024  int __pyx_t_9;
16025  int __pyx_lineno = 0;
16026  const char *__pyx_filename = NULL;
16027  int __pyx_clineno = 0;
16028 
16029  /* "View.MemoryView":944
16030  * @cname('__pyx_memslice_transpose')
16031  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16032  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
16033  *
16034  * cdef Py_ssize_t *shape = memslice.shape
16035  */
16036  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16037  __pyx_v_ndim = __pyx_t_1;
16038 
16039  /* "View.MemoryView":946
16040  * cdef int ndim = memslice.memview.view.ndim
16041  *
16042  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
16043  * cdef Py_ssize_t *strides = memslice.strides
16044  *
16045  */
16046  __pyx_t_2 = __pyx_v_memslice->shape;
16047  __pyx_v_shape = __pyx_t_2;
16048 
16049  /* "View.MemoryView":947
16050  *
16051  * cdef Py_ssize_t *shape = memslice.shape
16052  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
16053  *
16054  *
16055  */
16056  __pyx_t_2 = __pyx_v_memslice->strides;
16057  __pyx_v_strides = __pyx_t_2;
16058 
16059  /* "View.MemoryView":951
16060  *
16061  * cdef int i, j
16062  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
16063  * j = ndim - 1 - i
16064  * strides[i], strides[j] = strides[j], strides[i]
16065  */
16066  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16067  __pyx_t_4 = __pyx_t_3;
16068  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16069  __pyx_v_i = __pyx_t_1;
16070 
16071  /* "View.MemoryView":952
16072  * cdef int i, j
16073  * for i in range(ndim / 2):
16074  * j = ndim - 1 - i # <<<<<<<<<<<<<<
16075  * strides[i], strides[j] = strides[j], strides[i]
16076  * shape[i], shape[j] = shape[j], shape[i]
16077  */
16078  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16079 
16080  /* "View.MemoryView":953
16081  * for i in range(ndim / 2):
16082  * j = ndim - 1 - i
16083  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
16084  * shape[i], shape[j] = shape[j], shape[i]
16085  *
16086  */
16087  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16088  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16089  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16090  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16091 
16092  /* "View.MemoryView":954
16093  * j = ndim - 1 - i
16094  * strides[i], strides[j] = strides[j], strides[i]
16095  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
16096  *
16097  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16098  */
16099  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16100  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16101  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16102  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16103 
16104  /* "View.MemoryView":956
16105  * shape[i], shape[j] = shape[j], shape[i]
16106  *
16107  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16108  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16109  *
16110  */
16111  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16112  if (!__pyx_t_8) {
16113  } else {
16114  __pyx_t_7 = __pyx_t_8;
16115  goto __pyx_L6_bool_binop_done;
16116  }
16117  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16118  __pyx_t_7 = __pyx_t_8;
16119  __pyx_L6_bool_binop_done:;
16120  if (__pyx_t_7) {
16121 
16122  /* "View.MemoryView":957
16123  *
16124  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16125  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
16126  *
16127  * return 1
16128  */
16129  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
16130 
16131  /* "View.MemoryView":956
16132  * shape[i], shape[j] = shape[j], shape[i]
16133  *
16134  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16135  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16136  *
16137  */
16138  }
16139  }
16140 
16141  /* "View.MemoryView":959
16142  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16143  *
16144  * return 1 # <<<<<<<<<<<<<<
16145  *
16146  *
16147  */
16148  __pyx_r = 1;
16149  goto __pyx_L0;
16150 
16151  /* "View.MemoryView":943
16152  *
16153  * @cname('__pyx_memslice_transpose')
16154  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16155  * cdef int ndim = memslice.memview.view.ndim
16156  *
16157  */
16158 
16159  /* function exit code */
16160  __pyx_L1_error:;
16161  {
16162  #ifdef WITH_THREAD
16163  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16164  #endif
16165  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16166  #ifdef WITH_THREAD
16167  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16168  #endif
16169  }
16170  __pyx_r = 0;
16171  __pyx_L0:;
16172  return __pyx_r;
16173 }
16174 
16175 /* "View.MemoryView":976
16176  * cdef int (*to_dtype_func)(char *, object) except 0
16177  *
16178  * def __dealloc__(self): # <<<<<<<<<<<<<<
16179  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16180  *
16181  */
16182 
16183 /* Python wrapper */
16184 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
16185 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16186  __Pyx_RefNannyDeclarations
16187  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
16188  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16189 
16190  /* function exit code */
16191  __Pyx_RefNannyFinishContext();
16192 }
16193 
16194 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16195  __Pyx_RefNannyDeclarations
16196  __Pyx_RefNannySetupContext("__dealloc__", 0);
16197 
16198  /* "View.MemoryView":977
16199  *
16200  * def __dealloc__(self):
16201  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
16202  *
16203  * cdef convert_item_to_object(self, char *itemp):
16204  */
16205  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16206 
16207  /* "View.MemoryView":976
16208  * cdef int (*to_dtype_func)(char *, object) except 0
16209  *
16210  * def __dealloc__(self): # <<<<<<<<<<<<<<
16211  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16212  *
16213  */
16214 
16215  /* function exit code */
16216  __Pyx_RefNannyFinishContext();
16217 }
16218 
16219 /* "View.MemoryView":979
16220  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16221  *
16222  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16223  * if self.to_object_func != NULL:
16224  * return self.to_object_func(itemp)
16225  */
16226 
16227 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
16228  PyObject *__pyx_r = NULL;
16229  __Pyx_RefNannyDeclarations
16230  int __pyx_t_1;
16231  PyObject *__pyx_t_2 = NULL;
16232  int __pyx_lineno = 0;
16233  const char *__pyx_filename = NULL;
16234  int __pyx_clineno = 0;
16235  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
16236 
16237  /* "View.MemoryView":980
16238  *
16239  * cdef convert_item_to_object(self, char *itemp):
16240  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16241  * return self.to_object_func(itemp)
16242  * else:
16243  */
16244  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16245  if (__pyx_t_1) {
16246 
16247  /* "View.MemoryView":981
16248  * cdef convert_item_to_object(self, char *itemp):
16249  * if self.to_object_func != NULL:
16250  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
16251  * else:
16252  * return memoryview.convert_item_to_object(self, itemp)
16253  */
16254  __Pyx_XDECREF(__pyx_r);
16255  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
16256  __Pyx_GOTREF(__pyx_t_2);
16257  __pyx_r = __pyx_t_2;
16258  __pyx_t_2 = 0;
16259  goto __pyx_L0;
16260 
16261  /* "View.MemoryView":980
16262  *
16263  * cdef convert_item_to_object(self, char *itemp):
16264  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16265  * return self.to_object_func(itemp)
16266  * else:
16267  */
16268  }
16269 
16270  /* "View.MemoryView":983
16271  * return self.to_object_func(itemp)
16272  * else:
16273  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
16274  *
16275  * cdef assign_item_from_object(self, char *itemp, object value):
16276  */
16277  /*else*/ {
16278  __Pyx_XDECREF(__pyx_r);
16279  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
16280  __Pyx_GOTREF(__pyx_t_2);
16281  __pyx_r = __pyx_t_2;
16282  __pyx_t_2 = 0;
16283  goto __pyx_L0;
16284  }
16285 
16286  /* "View.MemoryView":979
16287  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16288  *
16289  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16290  * if self.to_object_func != NULL:
16291  * return self.to_object_func(itemp)
16292  */
16293 
16294  /* function exit code */
16295  __pyx_L1_error:;
16296  __Pyx_XDECREF(__pyx_t_2);
16297  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16298  __pyx_r = 0;
16299  __pyx_L0:;
16300  __Pyx_XGIVEREF(__pyx_r);
16301  __Pyx_RefNannyFinishContext();
16302  return __pyx_r;
16303 }
16304 
16305 /* "View.MemoryView":985
16306  * return memoryview.convert_item_to_object(self, itemp)
16307  *
16308  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16309  * if self.to_dtype_func != NULL:
16310  * self.to_dtype_func(itemp, value)
16311  */
16312 
16313 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16314  PyObject *__pyx_r = NULL;
16315  __Pyx_RefNannyDeclarations
16316  int __pyx_t_1;
16317  int __pyx_t_2;
16318  PyObject *__pyx_t_3 = NULL;
16319  int __pyx_lineno = 0;
16320  const char *__pyx_filename = NULL;
16321  int __pyx_clineno = 0;
16322  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
16323 
16324  /* "View.MemoryView":986
16325  *
16326  * cdef assign_item_from_object(self, char *itemp, object value):
16327  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16328  * self.to_dtype_func(itemp, value)
16329  * else:
16330  */
16331  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16332  if (__pyx_t_1) {
16333 
16334  /* "View.MemoryView":987
16335  * cdef assign_item_from_object(self, char *itemp, object value):
16336  * if self.to_dtype_func != NULL:
16337  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
16338  * else:
16339  * memoryview.assign_item_from_object(self, itemp, value)
16340  */
16341  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
16342 
16343  /* "View.MemoryView":986
16344  *
16345  * cdef assign_item_from_object(self, char *itemp, object value):
16346  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16347  * self.to_dtype_func(itemp, value)
16348  * else:
16349  */
16350  goto __pyx_L3;
16351  }
16352 
16353  /* "View.MemoryView":989
16354  * self.to_dtype_func(itemp, value)
16355  * else:
16356  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
16357  *
16358  * @property
16359  */
16360  /*else*/ {
16361  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
16362  __Pyx_GOTREF(__pyx_t_3);
16363  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16364  }
16365  __pyx_L3:;
16366 
16367  /* "View.MemoryView":985
16368  * return memoryview.convert_item_to_object(self, itemp)
16369  *
16370  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16371  * if self.to_dtype_func != NULL:
16372  * self.to_dtype_func(itemp, value)
16373  */
16374 
16375  /* function exit code */
16376  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16377  goto __pyx_L0;
16378  __pyx_L1_error:;
16379  __Pyx_XDECREF(__pyx_t_3);
16380  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16381  __pyx_r = 0;
16382  __pyx_L0:;
16383  __Pyx_XGIVEREF(__pyx_r);
16384  __Pyx_RefNannyFinishContext();
16385  return __pyx_r;
16386 }
16387 
16388 /* "View.MemoryView":992
16389  *
16390  * @property
16391  * def base(self): # <<<<<<<<<<<<<<
16392  * return self.from_object
16393  *
16394  */
16395 
16396 /* Python wrapper */
16397 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
16398 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16399  PyObject *__pyx_r = 0;
16400  __Pyx_RefNannyDeclarations
16401  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16402  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16403 
16404  /* function exit code */
16405  __Pyx_RefNannyFinishContext();
16406  return __pyx_r;
16407 }
16408 
16409 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16410  PyObject *__pyx_r = NULL;
16411  __Pyx_RefNannyDeclarations
16412  __Pyx_RefNannySetupContext("__get__", 0);
16413 
16414  /* "View.MemoryView":993
16415  * @property
16416  * def base(self):
16417  * return self.from_object # <<<<<<<<<<<<<<
16418  *
16419  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
16420  */
16421  __Pyx_XDECREF(__pyx_r);
16422  __Pyx_INCREF(__pyx_v_self->from_object);
16423  __pyx_r = __pyx_v_self->from_object;
16424  goto __pyx_L0;
16425 
16426  /* "View.MemoryView":992
16427  *
16428  * @property
16429  * def base(self): # <<<<<<<<<<<<<<
16430  * return self.from_object
16431  *
16432  */
16433 
16434  /* function exit code */
16435  __pyx_L0:;
16436  __Pyx_XGIVEREF(__pyx_r);
16437  __Pyx_RefNannyFinishContext();
16438  return __pyx_r;
16439 }
16440 
16441 /* "(tree fragment)":1
16442  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16443  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16444  * def __setstate_cython__(self, __pyx_state):
16445  */
16446 
16447 /* Python wrapper */
16448 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16449 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16450  PyObject *__pyx_r = 0;
16451  __Pyx_RefNannyDeclarations
16452  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
16453  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16454 
16455  /* function exit code */
16456  __Pyx_RefNannyFinishContext();
16457  return __pyx_r;
16458 }
16459 
16460 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16461  PyObject *__pyx_r = NULL;
16462  __Pyx_RefNannyDeclarations
16463  PyObject *__pyx_t_1 = NULL;
16464  int __pyx_lineno = 0;
16465  const char *__pyx_filename = NULL;
16466  int __pyx_clineno = 0;
16467  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
16468 
16469  /* "(tree fragment)":2
16470  * def __reduce_cython__(self):
16471  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16472  * def __setstate_cython__(self, __pyx_state):
16473  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16474  */
16475  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
16476  __Pyx_GOTREF(__pyx_t_1);
16477  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16478  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16479  __PYX_ERR(1, 2, __pyx_L1_error)
16480 
16481  /* "(tree fragment)":1
16482  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16483  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16484  * def __setstate_cython__(self, __pyx_state):
16485  */
16486 
16487  /* function exit code */
16488  __pyx_L1_error:;
16489  __Pyx_XDECREF(__pyx_t_1);
16490  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16491  __pyx_r = NULL;
16492  __Pyx_XGIVEREF(__pyx_r);
16493  __Pyx_RefNannyFinishContext();
16494  return __pyx_r;
16495 }
16496 
16497 /* "(tree fragment)":3
16498  * def __reduce_cython__(self):
16499  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16500  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16501  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16502  */
16503 
16504 /* Python wrapper */
16505 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
16506 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16507  PyObject *__pyx_r = 0;
16508  __Pyx_RefNannyDeclarations
16509  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
16510  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16511 
16512  /* function exit code */
16513  __Pyx_RefNannyFinishContext();
16514  return __pyx_r;
16515 }
16516 
16517 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16518  PyObject *__pyx_r = NULL;
16519  __Pyx_RefNannyDeclarations
16520  PyObject *__pyx_t_1 = NULL;
16521  int __pyx_lineno = 0;
16522  const char *__pyx_filename = NULL;
16523  int __pyx_clineno = 0;
16524  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
16525 
16526  /* "(tree fragment)":4
16527  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16528  * def __setstate_cython__(self, __pyx_state):
16529  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16530  */
16531  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
16532  __Pyx_GOTREF(__pyx_t_1);
16533  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16534  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16535  __PYX_ERR(1, 4, __pyx_L1_error)
16536 
16537  /* "(tree fragment)":3
16538  * def __reduce_cython__(self):
16539  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16540  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16541  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16542  */
16543 
16544  /* function exit code */
16545  __pyx_L1_error:;
16546  __Pyx_XDECREF(__pyx_t_1);
16547  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16548  __pyx_r = NULL;
16549  __Pyx_XGIVEREF(__pyx_r);
16550  __Pyx_RefNannyFinishContext();
16551  return __pyx_r;
16552 }
16553 
16554 /* "View.MemoryView":999
16555  *
16556  * @cname('__pyx_memoryview_fromslice')
16557  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16558  * int ndim,
16559  * object (*to_object_func)(char *),
16560  */
16561 
16562 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
16563  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16564  Py_ssize_t __pyx_v_suboffset;
16565  PyObject *__pyx_v_length = NULL;
16566  PyObject *__pyx_r = NULL;
16567  __Pyx_RefNannyDeclarations
16568  int __pyx_t_1;
16569  PyObject *__pyx_t_2 = NULL;
16570  PyObject *__pyx_t_3 = NULL;
16571  __Pyx_TypeInfo *__pyx_t_4;
16572  Py_buffer __pyx_t_5;
16573  Py_ssize_t *__pyx_t_6;
16574  Py_ssize_t *__pyx_t_7;
16575  Py_ssize_t *__pyx_t_8;
16576  Py_ssize_t __pyx_t_9;
16577  int __pyx_lineno = 0;
16578  const char *__pyx_filename = NULL;
16579  int __pyx_clineno = 0;
16580  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
16581 
16582  /* "View.MemoryView":1007
16583  * cdef _memoryviewslice result
16584  *
16585  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16586  * return None
16587  *
16588  */
16589  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
16590  if (__pyx_t_1) {
16591 
16592  /* "View.MemoryView":1008
16593  *
16594  * if <PyObject *> memviewslice.memview == Py_None:
16595  * return None # <<<<<<<<<<<<<<
16596  *
16597  *
16598  */
16599  __Pyx_XDECREF(__pyx_r);
16600  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16601  goto __pyx_L0;
16602 
16603  /* "View.MemoryView":1007
16604  * cdef _memoryviewslice result
16605  *
16606  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16607  * return None
16608  *
16609  */
16610  }
16611 
16612  /* "View.MemoryView":1013
16613  *
16614  *
16615  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
16616  *
16617  * result.from_slice = memviewslice
16618  */
16619  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
16620  __Pyx_GOTREF(__pyx_t_2);
16621  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
16622  __Pyx_GOTREF(__pyx_t_3);
16623  __Pyx_INCREF(Py_None);
16624  __Pyx_GIVEREF(Py_None);
16625  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
16626  __Pyx_INCREF(__pyx_int_0);
16627  __Pyx_GIVEREF(__pyx_int_0);
16628  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
16629  __Pyx_GIVEREF(__pyx_t_2);
16630  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
16631  __pyx_t_2 = 0;
16632  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
16633  __Pyx_GOTREF(__pyx_t_2);
16634  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16635  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
16636  __pyx_t_2 = 0;
16637 
16638  /* "View.MemoryView":1015
16639  * result = _memoryviewslice(None, 0, dtype_is_object)
16640  *
16641  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
16642  * __PYX_INC_MEMVIEW(&memviewslice, 1)
16643  *
16644  */
16645  __pyx_v_result->from_slice = __pyx_v_memviewslice;
16646 
16647  /* "View.MemoryView":1016
16648  *
16649  * result.from_slice = memviewslice
16650  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
16651  *
16652  * result.from_object = (<memoryview> memviewslice.memview).base
16653  */
16654  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
16655 
16656  /* "View.MemoryView":1018
16657  * __PYX_INC_MEMVIEW(&memviewslice, 1)
16658  *
16659  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
16660  * result.typeinfo = memviewslice.memview.typeinfo
16661  *
16662  */
16663  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
16664  __Pyx_GOTREF(__pyx_t_2);
16665  __Pyx_GIVEREF(__pyx_t_2);
16666  __Pyx_GOTREF(__pyx_v_result->from_object);
16667  __Pyx_DECREF(__pyx_v_result->from_object);
16668  __pyx_v_result->from_object = __pyx_t_2;
16669  __pyx_t_2 = 0;
16670 
16671  /* "View.MemoryView":1019
16672  *
16673  * result.from_object = (<memoryview> memviewslice.memview).base
16674  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
16675  *
16676  * result.view = memviewslice.memview.view
16677  */
16678  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
16679  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
16680 
16681  /* "View.MemoryView":1021
16682  * result.typeinfo = memviewslice.memview.typeinfo
16683  *
16684  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
16685  * result.view.buf = <void *> memviewslice.data
16686  * result.view.ndim = ndim
16687  */
16688  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
16689  __pyx_v_result->__pyx_base.view = __pyx_t_5;
16690 
16691  /* "View.MemoryView":1022
16692  *
16693  * result.view = memviewslice.memview.view
16694  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
16695  * result.view.ndim = ndim
16696  * (<__pyx_buffer *> &result.view).obj = Py_None
16697  */
16698  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
16699 
16700  /* "View.MemoryView":1023
16701  * result.view = memviewslice.memview.view
16702  * result.view.buf = <void *> memviewslice.data
16703  * result.view.ndim = ndim # <<<<<<<<<<<<<<
16704  * (<__pyx_buffer *> &result.view).obj = Py_None
16705  * Py_INCREF(Py_None)
16706  */
16707  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
16708 
16709  /* "View.MemoryView":1024
16710  * result.view.buf = <void *> memviewslice.data
16711  * result.view.ndim = ndim
16712  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
16713  * Py_INCREF(Py_None)
16714  *
16715  */
16716  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
16717 
16718  /* "View.MemoryView":1025
16719  * result.view.ndim = ndim
16720  * (<__pyx_buffer *> &result.view).obj = Py_None
16721  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
16722  *
16723  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
16724  */
16725  Py_INCREF(Py_None);
16726 
16727  /* "View.MemoryView":1027
16728  * Py_INCREF(Py_None)
16729  *
16730  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
16731  * result.flags = PyBUF_RECORDS
16732  * else:
16733  */
16734  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
16735  if (__pyx_t_1) {
16736 
16737  /* "View.MemoryView":1028
16738  *
16739  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
16740  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
16741  * else:
16742  * result.flags = PyBUF_RECORDS_RO
16743  */
16744  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
16745 
16746  /* "View.MemoryView":1027
16747  * Py_INCREF(Py_None)
16748  *
16749  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
16750  * result.flags = PyBUF_RECORDS
16751  * else:
16752  */
16753  goto __pyx_L4;
16754  }
16755 
16756  /* "View.MemoryView":1030
16757  * result.flags = PyBUF_RECORDS
16758  * else:
16759  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
16760  *
16761  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
16762  */
16763  /*else*/ {
16764  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
16765  }
16766  __pyx_L4:;
16767 
16768  /* "View.MemoryView":1032
16769  * result.flags = PyBUF_RECORDS_RO
16770  *
16771  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
16772  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
16773  *
16774  */
16775  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
16776 
16777  /* "View.MemoryView":1033
16778  *
16779  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
16780  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
16781  *
16782  *
16783  */
16784  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
16785 
16786  /* "View.MemoryView":1036
16787  *
16788  *
16789  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
16790  * for suboffset in result.from_slice.suboffsets[:ndim]:
16791  * if suboffset >= 0:
16792  */
16793  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
16794 
16795  /* "View.MemoryView":1037
16796  *
16797  * result.view.suboffsets = NULL
16798  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
16799  * if suboffset >= 0:
16800  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16801  */
16802  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
16803  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16804  __pyx_t_6 = __pyx_t_8;
16805  __pyx_v_suboffset = (__pyx_t_6[0]);
16806 
16807  /* "View.MemoryView":1038
16808  * result.view.suboffsets = NULL
16809  * for suboffset in result.from_slice.suboffsets[:ndim]:
16810  * if suboffset >= 0: # <<<<<<<<<<<<<<
16811  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16812  * break
16813  */
16814  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
16815  if (__pyx_t_1) {
16816 
16817  /* "View.MemoryView":1039
16818  * for suboffset in result.from_slice.suboffsets[:ndim]:
16819  * if suboffset >= 0:
16820  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
16821  * break
16822  *
16823  */
16824  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
16825 
16826  /* "View.MemoryView":1040
16827  * if suboffset >= 0:
16828  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16829  * break # <<<<<<<<<<<<<<
16830  *
16831  * result.view.len = result.view.itemsize
16832  */
16833  goto __pyx_L6_break;
16834 
16835  /* "View.MemoryView":1038
16836  * result.view.suboffsets = NULL
16837  * for suboffset in result.from_slice.suboffsets[:ndim]:
16838  * if suboffset >= 0: # <<<<<<<<<<<<<<
16839  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16840  * break
16841  */
16842  }
16843  }
16844  __pyx_L6_break:;
16845 
16846  /* "View.MemoryView":1042
16847  * break
16848  *
16849  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
16850  * for length in result.view.shape[:ndim]:
16851  * result.view.len *= length
16852  */
16853  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
16854  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16855 
16856  /* "View.MemoryView":1043
16857  *
16858  * result.view.len = result.view.itemsize
16859  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
16860  * result.view.len *= length
16861  *
16862  */
16863  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
16864  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16865  __pyx_t_6 = __pyx_t_8;
16866  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
16867  __Pyx_GOTREF(__pyx_t_2);
16868  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
16869  __pyx_t_2 = 0;
16870 
16871  /* "View.MemoryView":1044
16872  * result.view.len = result.view.itemsize
16873  * for length in result.view.shape[:ndim]:
16874  * result.view.len *= length # <<<<<<<<<<<<<<
16875  *
16876  * result.to_object_func = to_object_func
16877  */
16878  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
16879  __Pyx_GOTREF(__pyx_t_2);
16880  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
16881  __Pyx_GOTREF(__pyx_t_3);
16882  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16883  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
16884  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16885  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16886  }
16887 
16888  /* "View.MemoryView":1046
16889  * result.view.len *= length
16890  *
16891  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
16892  * result.to_dtype_func = to_dtype_func
16893  *
16894  */
16895  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
16896 
16897  /* "View.MemoryView":1047
16898  *
16899  * result.to_object_func = to_object_func
16900  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
16901  *
16902  * return result
16903  */
16904  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
16905 
16906  /* "View.MemoryView":1049
16907  * result.to_dtype_func = to_dtype_func
16908  *
16909  * return result # <<<<<<<<<<<<<<
16910  *
16911  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16912  */
16913  __Pyx_XDECREF(__pyx_r);
16914  __Pyx_INCREF(((PyObject *)__pyx_v_result));
16915  __pyx_r = ((PyObject *)__pyx_v_result);
16916  goto __pyx_L0;
16917 
16918  /* "View.MemoryView":999
16919  *
16920  * @cname('__pyx_memoryview_fromslice')
16921  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16922  * int ndim,
16923  * object (*to_object_func)(char *),
16924  */
16925 
16926  /* function exit code */
16927  __pyx_L1_error:;
16928  __Pyx_XDECREF(__pyx_t_2);
16929  __Pyx_XDECREF(__pyx_t_3);
16930  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16931  __pyx_r = 0;
16932  __pyx_L0:;
16933  __Pyx_XDECREF((PyObject *)__pyx_v_result);
16934  __Pyx_XDECREF(__pyx_v_length);
16935  __Pyx_XGIVEREF(__pyx_r);
16936  __Pyx_RefNannyFinishContext();
16937  return __pyx_r;
16938 }
16939 
16940 /* "View.MemoryView":1052
16941  *
16942  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16943  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16944  * __Pyx_memviewslice *mslice) except NULL:
16945  * cdef _memoryviewslice obj
16946  */
16947 
16948 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
16949  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
16950  __Pyx_memviewslice *__pyx_r;
16951  __Pyx_RefNannyDeclarations
16952  int __pyx_t_1;
16953  int __pyx_t_2;
16954  PyObject *__pyx_t_3 = NULL;
16955  int __pyx_lineno = 0;
16956  const char *__pyx_filename = NULL;
16957  int __pyx_clineno = 0;
16958  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
16959 
16960  /* "View.MemoryView":1055
16961  * __Pyx_memviewslice *mslice) except NULL:
16962  * cdef _memoryviewslice obj
16963  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16964  * obj = memview
16965  * return &obj.from_slice
16966  */
16967  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16968  __pyx_t_2 = (__pyx_t_1 != 0);
16969  if (__pyx_t_2) {
16970 
16971  /* "View.MemoryView":1056
16972  * cdef _memoryviewslice obj
16973  * if isinstance(memview, _memoryviewslice):
16974  * obj = memview # <<<<<<<<<<<<<<
16975  * return &obj.from_slice
16976  * else:
16977  */
16978  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
16979  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16980  __Pyx_INCREF(__pyx_t_3);
16981  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16982  __pyx_t_3 = 0;
16983 
16984  /* "View.MemoryView":1057
16985  * if isinstance(memview, _memoryviewslice):
16986  * obj = memview
16987  * return &obj.from_slice # <<<<<<<<<<<<<<
16988  * else:
16989  * slice_copy(memview, mslice)
16990  */
16991  __pyx_r = (&__pyx_v_obj->from_slice);
16992  goto __pyx_L0;
16993 
16994  /* "View.MemoryView":1055
16995  * __Pyx_memviewslice *mslice) except NULL:
16996  * cdef _memoryviewslice obj
16997  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16998  * obj = memview
16999  * return &obj.from_slice
17000  */
17001  }
17002 
17003  /* "View.MemoryView":1059
17004  * return &obj.from_slice
17005  * else:
17006  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
17007  * return mslice
17008  *
17009  */
17010  /*else*/ {
17011  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17012 
17013  /* "View.MemoryView":1060
17014  * else:
17015  * slice_copy(memview, mslice)
17016  * return mslice # <<<<<<<<<<<<<<
17017  *
17018  * @cname('__pyx_memoryview_slice_copy')
17019  */
17020  __pyx_r = __pyx_v_mslice;
17021  goto __pyx_L0;
17022  }
17023 
17024  /* "View.MemoryView":1052
17025  *
17026  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17027  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17028  * __Pyx_memviewslice *mslice) except NULL:
17029  * cdef _memoryviewslice obj
17030  */
17031 
17032  /* function exit code */
17033  __pyx_L1_error:;
17034  __Pyx_XDECREF(__pyx_t_3);
17035  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17036  __pyx_r = NULL;
17037  __pyx_L0:;
17038  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17039  __Pyx_RefNannyFinishContext();
17040  return __pyx_r;
17041 }
17042 
17043 /* "View.MemoryView":1063
17044  *
17045  * @cname('__pyx_memoryview_slice_copy')
17046  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17047  * cdef int dim
17048  * cdef (Py_ssize_t*) shape, strides, suboffsets
17049  */
17050 
17051 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17052  int __pyx_v_dim;
17053  Py_ssize_t *__pyx_v_shape;
17054  Py_ssize_t *__pyx_v_strides;
17055  Py_ssize_t *__pyx_v_suboffsets;
17056  __Pyx_RefNannyDeclarations
17057  Py_ssize_t *__pyx_t_1;
17058  int __pyx_t_2;
17059  int __pyx_t_3;
17060  int __pyx_t_4;
17061  Py_ssize_t __pyx_t_5;
17062  __Pyx_RefNannySetupContext("slice_copy", 0);
17063 
17064  /* "View.MemoryView":1067
17065  * cdef (Py_ssize_t*) shape, strides, suboffsets
17066  *
17067  * shape = memview.view.shape # <<<<<<<<<<<<<<
17068  * strides = memview.view.strides
17069  * suboffsets = memview.view.suboffsets
17070  */
17071  __pyx_t_1 = __pyx_v_memview->view.shape;
17072  __pyx_v_shape = __pyx_t_1;
17073 
17074  /* "View.MemoryView":1068
17075  *
17076  * shape = memview.view.shape
17077  * strides = memview.view.strides # <<<<<<<<<<<<<<
17078  * suboffsets = memview.view.suboffsets
17079  *
17080  */
17081  __pyx_t_1 = __pyx_v_memview->view.strides;
17082  __pyx_v_strides = __pyx_t_1;
17083 
17084  /* "View.MemoryView":1069
17085  * shape = memview.view.shape
17086  * strides = memview.view.strides
17087  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
17088  *
17089  * dst.memview = <__pyx_memoryview *> memview
17090  */
17091  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17092  __pyx_v_suboffsets = __pyx_t_1;
17093 
17094  /* "View.MemoryView":1071
17095  * suboffsets = memview.view.suboffsets
17096  *
17097  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
17098  * dst.data = <char *> memview.view.buf
17099  *
17100  */
17101  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
17102 
17103  /* "View.MemoryView":1072
17104  *
17105  * dst.memview = <__pyx_memoryview *> memview
17106  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
17107  *
17108  * for dim in range(memview.view.ndim):
17109  */
17110  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
17111 
17112  /* "View.MemoryView":1074
17113  * dst.data = <char *> memview.view.buf
17114  *
17115  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
17116  * dst.shape[dim] = shape[dim]
17117  * dst.strides[dim] = strides[dim]
17118  */
17119  __pyx_t_2 = __pyx_v_memview->view.ndim;
17120  __pyx_t_3 = __pyx_t_2;
17121  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17122  __pyx_v_dim = __pyx_t_4;
17123 
17124  /* "View.MemoryView":1075
17125  *
17126  * for dim in range(memview.view.ndim):
17127  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
17128  * dst.strides[dim] = strides[dim]
17129  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17130  */
17131  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17132 
17133  /* "View.MemoryView":1076
17134  * for dim in range(memview.view.ndim):
17135  * dst.shape[dim] = shape[dim]
17136  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
17137  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17138  *
17139  */
17140  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17141 
17142  /* "View.MemoryView":1077
17143  * dst.shape[dim] = shape[dim]
17144  * dst.strides[dim] = strides[dim]
17145  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
17146  *
17147  * @cname('__pyx_memoryview_copy_object')
17148  */
17149  if ((__pyx_v_suboffsets != 0)) {
17150  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17151  } else {
17152  __pyx_t_5 = -1L;
17153  }
17154  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17155  }
17156 
17157  /* "View.MemoryView":1063
17158  *
17159  * @cname('__pyx_memoryview_slice_copy')
17160  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17161  * cdef int dim
17162  * cdef (Py_ssize_t*) shape, strides, suboffsets
17163  */
17164 
17165  /* function exit code */
17166  __Pyx_RefNannyFinishContext();
17167 }
17168 
17169 /* "View.MemoryView":1080
17170  *
17171  * @cname('__pyx_memoryview_copy_object')
17172  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17173  * "Create a new memoryview object"
17174  * cdef __Pyx_memviewslice memviewslice
17175  */
17176 
17177 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
17178  __Pyx_memviewslice __pyx_v_memviewslice;
17179  PyObject *__pyx_r = NULL;
17180  __Pyx_RefNannyDeclarations
17181  PyObject *__pyx_t_1 = NULL;
17182  int __pyx_lineno = 0;
17183  const char *__pyx_filename = NULL;
17184  int __pyx_clineno = 0;
17185  __Pyx_RefNannySetupContext("memoryview_copy", 0);
17186 
17187  /* "View.MemoryView":1083
17188  * "Create a new memoryview object"
17189  * cdef __Pyx_memviewslice memviewslice
17190  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
17191  * return memoryview_copy_from_slice(memview, &memviewslice)
17192  *
17193  */
17194  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17195 
17196  /* "View.MemoryView":1084
17197  * cdef __Pyx_memviewslice memviewslice
17198  * slice_copy(memview, &memviewslice)
17199  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
17200  *
17201  * @cname('__pyx_memoryview_copy_object_from_slice')
17202  */
17203  __Pyx_XDECREF(__pyx_r);
17204  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
17205  __Pyx_GOTREF(__pyx_t_1);
17206  __pyx_r = __pyx_t_1;
17207  __pyx_t_1 = 0;
17208  goto __pyx_L0;
17209 
17210  /* "View.MemoryView":1080
17211  *
17212  * @cname('__pyx_memoryview_copy_object')
17213  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17214  * "Create a new memoryview object"
17215  * cdef __Pyx_memviewslice memviewslice
17216  */
17217 
17218  /* function exit code */
17219  __pyx_L1_error:;
17220  __Pyx_XDECREF(__pyx_t_1);
17221  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17222  __pyx_r = 0;
17223  __pyx_L0:;
17224  __Pyx_XGIVEREF(__pyx_r);
17225  __Pyx_RefNannyFinishContext();
17226  return __pyx_r;
17227 }
17228 
17229 /* "View.MemoryView":1087
17230  *
17231  * @cname('__pyx_memoryview_copy_object_from_slice')
17232  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17233  * """
17234  * Create a new memoryview object from a given memoryview object and slice.
17235  */
17236 
17237 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17238  PyObject *(*__pyx_v_to_object_func)(char *);
17239  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
17240  PyObject *__pyx_r = NULL;
17241  __Pyx_RefNannyDeclarations
17242  int __pyx_t_1;
17243  int __pyx_t_2;
17244  PyObject *(*__pyx_t_3)(char *);
17245  int (*__pyx_t_4)(char *, PyObject *);
17246  PyObject *__pyx_t_5 = NULL;
17247  int __pyx_lineno = 0;
17248  const char *__pyx_filename = NULL;
17249  int __pyx_clineno = 0;
17250  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
17251 
17252  /* "View.MemoryView":1094
17253  * cdef int (*to_dtype_func)(char *, object) except 0
17254  *
17255  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17256  * to_object_func = (<_memoryviewslice> memview).to_object_func
17257  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17258  */
17259  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17260  __pyx_t_2 = (__pyx_t_1 != 0);
17261  if (__pyx_t_2) {
17262 
17263  /* "View.MemoryView":1095
17264  *
17265  * if isinstance(memview, _memoryviewslice):
17266  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
17267  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17268  * else:
17269  */
17270  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17271  __pyx_v_to_object_func = __pyx_t_3;
17272 
17273  /* "View.MemoryView":1096
17274  * if isinstance(memview, _memoryviewslice):
17275  * to_object_func = (<_memoryviewslice> memview).to_object_func
17276  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
17277  * else:
17278  * to_object_func = NULL
17279  */
17280  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17281  __pyx_v_to_dtype_func = __pyx_t_4;
17282 
17283  /* "View.MemoryView":1094
17284  * cdef int (*to_dtype_func)(char *, object) except 0
17285  *
17286  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17287  * to_object_func = (<_memoryviewslice> memview).to_object_func
17288  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17289  */
17290  goto __pyx_L3;
17291  }
17292 
17293  /* "View.MemoryView":1098
17294  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17295  * else:
17296  * to_object_func = NULL # <<<<<<<<<<<<<<
17297  * to_dtype_func = NULL
17298  *
17299  */
17300  /*else*/ {
17301  __pyx_v_to_object_func = NULL;
17302 
17303  /* "View.MemoryView":1099
17304  * else:
17305  * to_object_func = NULL
17306  * to_dtype_func = NULL # <<<<<<<<<<<<<<
17307  *
17308  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17309  */
17310  __pyx_v_to_dtype_func = NULL;
17311  }
17312  __pyx_L3:;
17313 
17314  /* "View.MemoryView":1101
17315  * to_dtype_func = NULL
17316  *
17317  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
17318  * to_object_func, to_dtype_func,
17319  * memview.dtype_is_object)
17320  */
17321  __Pyx_XDECREF(__pyx_r);
17322 
17323  /* "View.MemoryView":1103
17324  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17325  * to_object_func, to_dtype_func,
17326  * memview.dtype_is_object) # <<<<<<<<<<<<<<
17327  *
17328  *
17329  */
17330  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
17331  __Pyx_GOTREF(__pyx_t_5);
17332  __pyx_r = __pyx_t_5;
17333  __pyx_t_5 = 0;
17334  goto __pyx_L0;
17335 
17336  /* "View.MemoryView":1087
17337  *
17338  * @cname('__pyx_memoryview_copy_object_from_slice')
17339  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17340  * """
17341  * Create a new memoryview object from a given memoryview object and slice.
17342  */
17343 
17344  /* function exit code */
17345  __pyx_L1_error:;
17346  __Pyx_XDECREF(__pyx_t_5);
17347  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17348  __pyx_r = 0;
17349  __pyx_L0:;
17350  __Pyx_XGIVEREF(__pyx_r);
17351  __Pyx_RefNannyFinishContext();
17352  return __pyx_r;
17353 }
17354 
17355 /* "View.MemoryView":1109
17356  *
17357  *
17358  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17359  * if arg < 0:
17360  * return -arg
17361  */
17362 
17363 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17364  Py_ssize_t __pyx_r;
17365  int __pyx_t_1;
17366 
17367  /* "View.MemoryView":1110
17368  *
17369  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17370  * if arg < 0: # <<<<<<<<<<<<<<
17371  * return -arg
17372  * else:
17373  */
17374  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17375  if (__pyx_t_1) {
17376 
17377  /* "View.MemoryView":1111
17378  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17379  * if arg < 0:
17380  * return -arg # <<<<<<<<<<<<<<
17381  * else:
17382  * return arg
17383  */
17384  __pyx_r = (-__pyx_v_arg);
17385  goto __pyx_L0;
17386 
17387  /* "View.MemoryView":1110
17388  *
17389  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17390  * if arg < 0: # <<<<<<<<<<<<<<
17391  * return -arg
17392  * else:
17393  */
17394  }
17395 
17396  /* "View.MemoryView":1113
17397  * return -arg
17398  * else:
17399  * return arg # <<<<<<<<<<<<<<
17400  *
17401  * @cname('__pyx_get_best_slice_order')
17402  */
17403  /*else*/ {
17404  __pyx_r = __pyx_v_arg;
17405  goto __pyx_L0;
17406  }
17407 
17408  /* "View.MemoryView":1109
17409  *
17410  *
17411  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17412  * if arg < 0:
17413  * return -arg
17414  */
17415 
17416  /* function exit code */
17417  __pyx_L0:;
17418  return __pyx_r;
17419 }
17420 
17421 /* "View.MemoryView":1116
17422  *
17423  * @cname('__pyx_get_best_slice_order')
17424  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
17425  * """
17426  * Figure out the best memory access order for a given slice.
17427  */
17428 
17429 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
17430  int __pyx_v_i;
17431  Py_ssize_t __pyx_v_c_stride;
17432  Py_ssize_t __pyx_v_f_stride;
17433  char __pyx_r;
17434  int __pyx_t_1;
17435  int __pyx_t_2;
17436  int __pyx_t_3;
17437  int __pyx_t_4;
17438 
17439  /* "View.MemoryView":1121
17440  * """
17441  * cdef int i
17442  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
17443  * cdef Py_ssize_t f_stride = 0
17444  *
17445  */
17446  __pyx_v_c_stride = 0;
17447 
17448  /* "View.MemoryView":1122
17449  * cdef int i
17450  * cdef Py_ssize_t c_stride = 0
17451  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
17452  *
17453  * for i in range(ndim - 1, -1, -1):
17454  */
17455  __pyx_v_f_stride = 0;
17456 
17457  /* "View.MemoryView":1124
17458  * cdef Py_ssize_t f_stride = 0
17459  *
17460  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17461  * if mslice.shape[i] > 1:
17462  * c_stride = mslice.strides[i]
17463  */
17464  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17465  __pyx_v_i = __pyx_t_1;
17466 
17467  /* "View.MemoryView":1125
17468  *
17469  * for i in range(ndim - 1, -1, -1):
17470  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17471  * c_stride = mslice.strides[i]
17472  * break
17473  */
17474  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17475  if (__pyx_t_2) {
17476 
17477  /* "View.MemoryView":1126
17478  * for i in range(ndim - 1, -1, -1):
17479  * if mslice.shape[i] > 1:
17480  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
17481  * break
17482  *
17483  */
17484  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17485 
17486  /* "View.MemoryView":1127
17487  * if mslice.shape[i] > 1:
17488  * c_stride = mslice.strides[i]
17489  * break # <<<<<<<<<<<<<<
17490  *
17491  * for i in range(ndim):
17492  */
17493  goto __pyx_L4_break;
17494 
17495  /* "View.MemoryView":1125
17496  *
17497  * for i in range(ndim - 1, -1, -1):
17498  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17499  * c_stride = mslice.strides[i]
17500  * break
17501  */
17502  }
17503  }
17504  __pyx_L4_break:;
17505 
17506  /* "View.MemoryView":1129
17507  * break
17508  *
17509  * for i in range(ndim): # <<<<<<<<<<<<<<
17510  * if mslice.shape[i] > 1:
17511  * f_stride = mslice.strides[i]
17512  */
17513  __pyx_t_1 = __pyx_v_ndim;
17514  __pyx_t_3 = __pyx_t_1;
17515  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17516  __pyx_v_i = __pyx_t_4;
17517 
17518  /* "View.MemoryView":1130
17519  *
17520  * for i in range(ndim):
17521  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17522  * f_stride = mslice.strides[i]
17523  * break
17524  */
17525  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17526  if (__pyx_t_2) {
17527 
17528  /* "View.MemoryView":1131
17529  * for i in range(ndim):
17530  * if mslice.shape[i] > 1:
17531  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
17532  * break
17533  *
17534  */
17535  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17536 
17537  /* "View.MemoryView":1132
17538  * if mslice.shape[i] > 1:
17539  * f_stride = mslice.strides[i]
17540  * break # <<<<<<<<<<<<<<
17541  *
17542  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17543  */
17544  goto __pyx_L7_break;
17545 
17546  /* "View.MemoryView":1130
17547  *
17548  * for i in range(ndim):
17549  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17550  * f_stride = mslice.strides[i]
17551  * break
17552  */
17553  }
17554  }
17555  __pyx_L7_break:;
17556 
17557  /* "View.MemoryView":1134
17558  * break
17559  *
17560  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
17561  * return 'C'
17562  * else:
17563  */
17564  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
17565  if (__pyx_t_2) {
17566 
17567  /* "View.MemoryView":1135
17568  *
17569  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17570  * return 'C' # <<<<<<<<<<<<<<
17571  * else:
17572  * return 'F'
17573  */
17574  __pyx_r = 'C';
17575  goto __pyx_L0;
17576 
17577  /* "View.MemoryView":1134
17578  * break
17579  *
17580  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
17581  * return 'C'
17582  * else:
17583  */
17584  }
17585 
17586  /* "View.MemoryView":1137
17587  * return 'C'
17588  * else:
17589  * return 'F' # <<<<<<<<<<<<<<
17590  *
17591  * @cython.cdivision(True)
17592  */
17593  /*else*/ {
17594  __pyx_r = 'F';
17595  goto __pyx_L0;
17596  }
17597 
17598  /* "View.MemoryView":1116
17599  *
17600  * @cname('__pyx_get_best_slice_order')
17601  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
17602  * """
17603  * Figure out the best memory access order for a given slice.
17604  */
17605 
17606  /* function exit code */
17607  __pyx_L0:;
17608  return __pyx_r;
17609 }
17610 
17611 /* "View.MemoryView":1140
17612  *
17613  * @cython.cdivision(True)
17614  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17615  * char *dst_data, Py_ssize_t *dst_strides,
17616  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17617  */
17618 
17619 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
17620  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17621  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
17622  Py_ssize_t __pyx_v_dst_extent;
17623  Py_ssize_t __pyx_v_src_stride;
17624  Py_ssize_t __pyx_v_dst_stride;
17625  int __pyx_t_1;
17626  int __pyx_t_2;
17627  int __pyx_t_3;
17628  Py_ssize_t __pyx_t_4;
17629  Py_ssize_t __pyx_t_5;
17630  Py_ssize_t __pyx_t_6;
17631 
17632  /* "View.MemoryView":1147
17633  *
17634  * cdef Py_ssize_t i
17635  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
17636  * cdef Py_ssize_t dst_extent = dst_shape[0]
17637  * cdef Py_ssize_t src_stride = src_strides[0]
17638  */
17639  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
17640 
17641  /* "View.MemoryView":1148
17642  * cdef Py_ssize_t i
17643  * cdef Py_ssize_t src_extent = src_shape[0]
17644  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
17645  * cdef Py_ssize_t src_stride = src_strides[0]
17646  * cdef Py_ssize_t dst_stride = dst_strides[0]
17647  */
17648  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
17649 
17650  /* "View.MemoryView":1149
17651  * cdef Py_ssize_t src_extent = src_shape[0]
17652  * cdef Py_ssize_t dst_extent = dst_shape[0]
17653  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
17654  * cdef Py_ssize_t dst_stride = dst_strides[0]
17655  *
17656  */
17657  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
17658 
17659  /* "View.MemoryView":1150
17660  * cdef Py_ssize_t dst_extent = dst_shape[0]
17661  * cdef Py_ssize_t src_stride = src_strides[0]
17662  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
17663  *
17664  * if ndim == 1:
17665  */
17666  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
17667 
17668  /* "View.MemoryView":1152
17669  * cdef Py_ssize_t dst_stride = dst_strides[0]
17670  *
17671  * if ndim == 1: # <<<<<<<<<<<<<<
17672  * if (src_stride > 0 and dst_stride > 0 and
17673  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17674  */
17675  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
17676  if (__pyx_t_1) {
17677 
17678  /* "View.MemoryView":1153
17679  *
17680  * if ndim == 1:
17681  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17682  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17683  * memcpy(dst_data, src_data, itemsize * dst_extent)
17684  */
17685  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
17686  if (__pyx_t_2) {
17687  } else {
17688  __pyx_t_1 = __pyx_t_2;
17689  goto __pyx_L5_bool_binop_done;
17690  }
17691  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
17692  if (__pyx_t_2) {
17693  } else {
17694  __pyx_t_1 = __pyx_t_2;
17695  goto __pyx_L5_bool_binop_done;
17696  }
17697 
17698  /* "View.MemoryView":1154
17699  * if ndim == 1:
17700  * if (src_stride > 0 and dst_stride > 0 and
17701  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
17702  * memcpy(dst_data, src_data, itemsize * dst_extent)
17703  * else:
17704  */
17705  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
17706  if (__pyx_t_2) {
17707  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
17708  }
17709  __pyx_t_3 = (__pyx_t_2 != 0);
17710  __pyx_t_1 = __pyx_t_3;
17711  __pyx_L5_bool_binop_done:;
17712 
17713  /* "View.MemoryView":1153
17714  *
17715  * if ndim == 1:
17716  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17717  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17718  * memcpy(dst_data, src_data, itemsize * dst_extent)
17719  */
17720  if (__pyx_t_1) {
17721 
17722  /* "View.MemoryView":1155
17723  * if (src_stride > 0 and dst_stride > 0 and
17724  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17725  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
17726  * else:
17727  * for i in range(dst_extent):
17728  */
17729  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
17730 
17731  /* "View.MemoryView":1153
17732  *
17733  * if ndim == 1:
17734  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17735  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17736  * memcpy(dst_data, src_data, itemsize * dst_extent)
17737  */
17738  goto __pyx_L4;
17739  }
17740 
17741  /* "View.MemoryView":1157
17742  * memcpy(dst_data, src_data, itemsize * dst_extent)
17743  * else:
17744  * for i in range(dst_extent): # <<<<<<<<<<<<<<
17745  * memcpy(dst_data, src_data, itemsize)
17746  * src_data += src_stride
17747  */
17748  /*else*/ {
17749  __pyx_t_4 = __pyx_v_dst_extent;
17750  __pyx_t_5 = __pyx_t_4;
17751  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17752  __pyx_v_i = __pyx_t_6;
17753 
17754  /* "View.MemoryView":1158
17755  * else:
17756  * for i in range(dst_extent):
17757  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
17758  * src_data += src_stride
17759  * dst_data += dst_stride
17760  */
17761  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
17762 
17763  /* "View.MemoryView":1159
17764  * for i in range(dst_extent):
17765  * memcpy(dst_data, src_data, itemsize)
17766  * src_data += src_stride # <<<<<<<<<<<<<<
17767  * dst_data += dst_stride
17768  * else:
17769  */
17770  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17771 
17772  /* "View.MemoryView":1160
17773  * memcpy(dst_data, src_data, itemsize)
17774  * src_data += src_stride
17775  * dst_data += dst_stride # <<<<<<<<<<<<<<
17776  * else:
17777  * for i in range(dst_extent):
17778  */
17779  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17780  }
17781  }
17782  __pyx_L4:;
17783 
17784  /* "View.MemoryView":1152
17785  * cdef Py_ssize_t dst_stride = dst_strides[0]
17786  *
17787  * if ndim == 1: # <<<<<<<<<<<<<<
17788  * if (src_stride > 0 and dst_stride > 0 and
17789  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17790  */
17791  goto __pyx_L3;
17792  }
17793 
17794  /* "View.MemoryView":1162
17795  * dst_data += dst_stride
17796  * else:
17797  * for i in range(dst_extent): # <<<<<<<<<<<<<<
17798  * _copy_strided_to_strided(src_data, src_strides + 1,
17799  * dst_data, dst_strides + 1,
17800  */
17801  /*else*/ {
17802  __pyx_t_4 = __pyx_v_dst_extent;
17803  __pyx_t_5 = __pyx_t_4;
17804  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17805  __pyx_v_i = __pyx_t_6;
17806 
17807  /* "View.MemoryView":1163
17808  * else:
17809  * for i in range(dst_extent):
17810  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
17811  * dst_data, dst_strides + 1,
17812  * src_shape + 1, dst_shape + 1,
17813  */
17814  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
17815 
17816  /* "View.MemoryView":1167
17817  * src_shape + 1, dst_shape + 1,
17818  * ndim - 1, itemsize)
17819  * src_data += src_stride # <<<<<<<<<<<<<<
17820  * dst_data += dst_stride
17821  *
17822  */
17823  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17824 
17825  /* "View.MemoryView":1168
17826  * ndim - 1, itemsize)
17827  * src_data += src_stride
17828  * dst_data += dst_stride # <<<<<<<<<<<<<<
17829  *
17830  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
17831  */
17832  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17833  }
17834  }
17835  __pyx_L3:;
17836 
17837  /* "View.MemoryView":1140
17838  *
17839  * @cython.cdivision(True)
17840  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17841  * char *dst_data, Py_ssize_t *dst_strides,
17842  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17843  */
17844 
17845  /* function exit code */
17846 }
17847 
17848 /* "View.MemoryView":1170
17849  * dst_data += dst_stride
17850  *
17851  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17852  * __Pyx_memviewslice *dst,
17853  * int ndim, size_t itemsize) nogil:
17854  */
17855 
17856 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
17857 
17858  /* "View.MemoryView":1173
17859  * __Pyx_memviewslice *dst,
17860  * int ndim, size_t itemsize) nogil:
17861  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
17862  * src.shape, dst.shape, ndim, itemsize)
17863  *
17864  */
17865  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
17866 
17867  /* "View.MemoryView":1170
17868  * dst_data += dst_stride
17869  *
17870  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17871  * __Pyx_memviewslice *dst,
17872  * int ndim, size_t itemsize) nogil:
17873  */
17874 
17875  /* function exit code */
17876 }
17877 
17878 /* "View.MemoryView":1177
17879  *
17880  * @cname('__pyx_memoryview_slice_get_size')
17881  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
17882  * "Return the size of the memory occupied by the slice in number of bytes"
17883  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17884  */
17885 
17886 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
17887  Py_ssize_t __pyx_v_shape;
17888  Py_ssize_t __pyx_v_size;
17889  Py_ssize_t __pyx_r;
17890  Py_ssize_t __pyx_t_1;
17891  Py_ssize_t *__pyx_t_2;
17892  Py_ssize_t *__pyx_t_3;
17893  Py_ssize_t *__pyx_t_4;
17894 
17895  /* "View.MemoryView":1179
17896  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
17897  * "Return the size of the memory occupied by the slice in number of bytes"
17898  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
17899  *
17900  * for shape in src.shape[:ndim]:
17901  */
17902  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17903  __pyx_v_size = __pyx_t_1;
17904 
17905  /* "View.MemoryView":1181
17906  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17907  *
17908  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
17909  * size *= shape
17910  *
17911  */
17912  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
17913  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
17914  __pyx_t_2 = __pyx_t_4;
17915  __pyx_v_shape = (__pyx_t_2[0]);
17916 
17917  /* "View.MemoryView":1182
17918  *
17919  * for shape in src.shape[:ndim]:
17920  * size *= shape # <<<<<<<<<<<<<<
17921  *
17922  * return size
17923  */
17924  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
17925  }
17926 
17927  /* "View.MemoryView":1184
17928  * size *= shape
17929  *
17930  * return size # <<<<<<<<<<<<<<
17931  *
17932  * @cname('__pyx_fill_contig_strides_array')
17933  */
17934  __pyx_r = __pyx_v_size;
17935  goto __pyx_L0;
17936 
17937  /* "View.MemoryView":1177
17938  *
17939  * @cname('__pyx_memoryview_slice_get_size')
17940  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
17941  * "Return the size of the memory occupied by the slice in number of bytes"
17942  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17943  */
17944 
17945  /* function exit code */
17946  __pyx_L0:;
17947  return __pyx_r;
17948 }
17949 
17950 /* "View.MemoryView":1187
17951  *
17952  * @cname('__pyx_fill_contig_strides_array')
17953  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17954  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17955  * int ndim, char order) nogil:
17956  */
17957 
17958 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
17959  int __pyx_v_idx;
17960  Py_ssize_t __pyx_r;
17961  int __pyx_t_1;
17962  int __pyx_t_2;
17963  int __pyx_t_3;
17964  int __pyx_t_4;
17965 
17966  /* "View.MemoryView":1196
17967  * cdef int idx
17968  *
17969  * if order == 'F': # <<<<<<<<<<<<<<
17970  * for idx in range(ndim):
17971  * strides[idx] = stride
17972  */
17973  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
17974  if (__pyx_t_1) {
17975 
17976  /* "View.MemoryView":1197
17977  *
17978  * if order == 'F':
17979  * for idx in range(ndim): # <<<<<<<<<<<<<<
17980  * strides[idx] = stride
17981  * stride *= shape[idx]
17982  */
17983  __pyx_t_2 = __pyx_v_ndim;
17984  __pyx_t_3 = __pyx_t_2;
17985  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17986  __pyx_v_idx = __pyx_t_4;
17987 
17988  /* "View.MemoryView":1198
17989  * if order == 'F':
17990  * for idx in range(ndim):
17991  * strides[idx] = stride # <<<<<<<<<<<<<<
17992  * stride *= shape[idx]
17993  * else:
17994  */
17995  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17996 
17997  /* "View.MemoryView":1199
17998  * for idx in range(ndim):
17999  * strides[idx] = stride
18000  * stride *= shape[idx] # <<<<<<<<<<<<<<
18001  * else:
18002  * for idx in range(ndim - 1, -1, -1):
18003  */
18004  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18005  }
18006 
18007  /* "View.MemoryView":1196
18008  * cdef int idx
18009  *
18010  * if order == 'F': # <<<<<<<<<<<<<<
18011  * for idx in range(ndim):
18012  * strides[idx] = stride
18013  */
18014  goto __pyx_L3;
18015  }
18016 
18017  /* "View.MemoryView":1201
18018  * stride *= shape[idx]
18019  * else:
18020  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18021  * strides[idx] = stride
18022  * stride *= shape[idx]
18023  */
18024  /*else*/ {
18025  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18026  __pyx_v_idx = __pyx_t_2;
18027 
18028  /* "View.MemoryView":1202
18029  * else:
18030  * for idx in range(ndim - 1, -1, -1):
18031  * strides[idx] = stride # <<<<<<<<<<<<<<
18032  * stride *= shape[idx]
18033  *
18034  */
18035  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18036 
18037  /* "View.MemoryView":1203
18038  * for idx in range(ndim - 1, -1, -1):
18039  * strides[idx] = stride
18040  * stride *= shape[idx] # <<<<<<<<<<<<<<
18041  *
18042  * return stride
18043  */
18044  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18045  }
18046  }
18047  __pyx_L3:;
18048 
18049  /* "View.MemoryView":1205
18050  * stride *= shape[idx]
18051  *
18052  * return stride # <<<<<<<<<<<<<<
18053  *
18054  * @cname('__pyx_memoryview_copy_data_to_temp')
18055  */
18056  __pyx_r = __pyx_v_stride;
18057  goto __pyx_L0;
18058 
18059  /* "View.MemoryView":1187
18060  *
18061  * @cname('__pyx_fill_contig_strides_array')
18062  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18063  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18064  * int ndim, char order) nogil:
18065  */
18066 
18067  /* function exit code */
18068  __pyx_L0:;
18069  return __pyx_r;
18070 }
18071 
18072 /* "View.MemoryView":1208
18073  *
18074  * @cname('__pyx_memoryview_copy_data_to_temp')
18075  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18076  * __Pyx_memviewslice *tmpslice,
18077  * char order,
18078  */
18079 
18080 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
18081  int __pyx_v_i;
18082  void *__pyx_v_result;
18083  size_t __pyx_v_itemsize;
18084  size_t __pyx_v_size;
18085  void *__pyx_r;
18086  Py_ssize_t __pyx_t_1;
18087  int __pyx_t_2;
18088  int __pyx_t_3;
18089  struct __pyx_memoryview_obj *__pyx_t_4;
18090  int __pyx_t_5;
18091  int __pyx_t_6;
18092  int __pyx_lineno = 0;
18093  const char *__pyx_filename = NULL;
18094  int __pyx_clineno = 0;
18095 
18096  /* "View.MemoryView":1219
18097  * cdef void *result
18098  *
18099  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18100  * cdef size_t size = slice_get_size(src, ndim)
18101  *
18102  */
18103  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18104  __pyx_v_itemsize = __pyx_t_1;
18105 
18106  /* "View.MemoryView":1220
18107  *
18108  * cdef size_t itemsize = src.memview.view.itemsize
18109  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
18110  *
18111  * result = malloc(size)
18112  */
18113  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18114 
18115  /* "View.MemoryView":1222
18116  * cdef size_t size = slice_get_size(src, ndim)
18117  *
18118  * result = malloc(size) # <<<<<<<<<<<<<<
18119  * if not result:
18120  * _err(MemoryError, NULL)
18121  */
18122  __pyx_v_result = malloc(__pyx_v_size);
18123 
18124  /* "View.MemoryView":1223
18125  *
18126  * result = malloc(size)
18127  * if not result: # <<<<<<<<<<<<<<
18128  * _err(MemoryError, NULL)
18129  *
18130  */
18131  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18132  if (__pyx_t_2) {
18133 
18134  /* "View.MemoryView":1224
18135  * result = malloc(size)
18136  * if not result:
18137  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
18138  *
18139  *
18140  */
18141  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
18142 
18143  /* "View.MemoryView":1223
18144  *
18145  * result = malloc(size)
18146  * if not result: # <<<<<<<<<<<<<<
18147  * _err(MemoryError, NULL)
18148  *
18149  */
18150  }
18151 
18152  /* "View.MemoryView":1227
18153  *
18154  *
18155  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
18156  * tmpslice.memview = src.memview
18157  * for i in range(ndim):
18158  */
18159  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
18160 
18161  /* "View.MemoryView":1228
18162  *
18163  * tmpslice.data = <char *> result
18164  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
18165  * for i in range(ndim):
18166  * tmpslice.shape[i] = src.shape[i]
18167  */
18168  __pyx_t_4 = __pyx_v_src->memview;
18169  __pyx_v_tmpslice->memview = __pyx_t_4;
18170 
18171  /* "View.MemoryView":1229
18172  * tmpslice.data = <char *> result
18173  * tmpslice.memview = src.memview
18174  * for i in range(ndim): # <<<<<<<<<<<<<<
18175  * tmpslice.shape[i] = src.shape[i]
18176  * tmpslice.suboffsets[i] = -1
18177  */
18178  __pyx_t_3 = __pyx_v_ndim;
18179  __pyx_t_5 = __pyx_t_3;
18180  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18181  __pyx_v_i = __pyx_t_6;
18182 
18183  /* "View.MemoryView":1230
18184  * tmpslice.memview = src.memview
18185  * for i in range(ndim):
18186  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
18187  * tmpslice.suboffsets[i] = -1
18188  *
18189  */
18190  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18191 
18192  /* "View.MemoryView":1231
18193  * for i in range(ndim):
18194  * tmpslice.shape[i] = src.shape[i]
18195  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18196  *
18197  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
18198  */
18199  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18200  }
18201 
18202  /* "View.MemoryView":1233
18203  * tmpslice.suboffsets[i] = -1
18204  *
18205  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
18206  * ndim, order)
18207  *
18208  */
18209  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18210 
18211  /* "View.MemoryView":1237
18212  *
18213  *
18214  * for i in range(ndim): # <<<<<<<<<<<<<<
18215  * if tmpslice.shape[i] == 1:
18216  * tmpslice.strides[i] = 0
18217  */
18218  __pyx_t_3 = __pyx_v_ndim;
18219  __pyx_t_5 = __pyx_t_3;
18220  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18221  __pyx_v_i = __pyx_t_6;
18222 
18223  /* "View.MemoryView":1238
18224  *
18225  * for i in range(ndim):
18226  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18227  * tmpslice.strides[i] = 0
18228  *
18229  */
18230  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18231  if (__pyx_t_2) {
18232 
18233  /* "View.MemoryView":1239
18234  * for i in range(ndim):
18235  * if tmpslice.shape[i] == 1:
18236  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
18237  *
18238  * if slice_is_contig(src[0], order, ndim):
18239  */
18240  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18241 
18242  /* "View.MemoryView":1238
18243  *
18244  * for i in range(ndim):
18245  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18246  * tmpslice.strides[i] = 0
18247  *
18248  */
18249  }
18250  }
18251 
18252  /* "View.MemoryView":1241
18253  * tmpslice.strides[i] = 0
18254  *
18255  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18256  * memcpy(result, src.data, size)
18257  * else:
18258  */
18259  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18260  if (__pyx_t_2) {
18261 
18262  /* "View.MemoryView":1242
18263  *
18264  * if slice_is_contig(src[0], order, ndim):
18265  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
18266  * else:
18267  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18268  */
18269  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18270 
18271  /* "View.MemoryView":1241
18272  * tmpslice.strides[i] = 0
18273  *
18274  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18275  * memcpy(result, src.data, size)
18276  * else:
18277  */
18278  goto __pyx_L9;
18279  }
18280 
18281  /* "View.MemoryView":1244
18282  * memcpy(result, src.data, size)
18283  * else:
18284  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
18285  *
18286  * return result
18287  */
18288  /*else*/ {
18289  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18290  }
18291  __pyx_L9:;
18292 
18293  /* "View.MemoryView":1246
18294  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18295  *
18296  * return result # <<<<<<<<<<<<<<
18297  *
18298  *
18299  */
18300  __pyx_r = __pyx_v_result;
18301  goto __pyx_L0;
18302 
18303  /* "View.MemoryView":1208
18304  *
18305  * @cname('__pyx_memoryview_copy_data_to_temp')
18306  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18307  * __Pyx_memviewslice *tmpslice,
18308  * char order,
18309  */
18310 
18311  /* function exit code */
18312  __pyx_L1_error:;
18313  {
18314  #ifdef WITH_THREAD
18315  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18316  #endif
18317  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18318  #ifdef WITH_THREAD
18319  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18320  #endif
18321  }
18322  __pyx_r = NULL;
18323  __pyx_L0:;
18324  return __pyx_r;
18325 }
18326 
18327 /* "View.MemoryView":1251
18328  *
18329  * @cname('__pyx_memoryview_err_extents')
18330  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18331  * Py_ssize_t extent2) except -1 with gil:
18332  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18333  */
18334 
18335 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18336  int __pyx_r;
18337  __Pyx_RefNannyDeclarations
18338  PyObject *__pyx_t_1 = NULL;
18339  PyObject *__pyx_t_2 = NULL;
18340  PyObject *__pyx_t_3 = NULL;
18341  PyObject *__pyx_t_4 = NULL;
18342  int __pyx_lineno = 0;
18343  const char *__pyx_filename = NULL;
18344  int __pyx_clineno = 0;
18345  #ifdef WITH_THREAD
18346  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18347  #endif
18348  __Pyx_RefNannySetupContext("_err_extents", 0);
18349 
18350  /* "View.MemoryView":1254
18351  * Py_ssize_t extent2) except -1 with gil:
18352  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18353  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
18354  *
18355  * @cname('__pyx_memoryview_err_dim')
18356  */
18357  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
18358  __Pyx_GOTREF(__pyx_t_1);
18359  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
18360  __Pyx_GOTREF(__pyx_t_2);
18361  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
18362  __Pyx_GOTREF(__pyx_t_3);
18363  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
18364  __Pyx_GOTREF(__pyx_t_4);
18365  __Pyx_GIVEREF(__pyx_t_1);
18366  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18367  __Pyx_GIVEREF(__pyx_t_2);
18368  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18369  __Pyx_GIVEREF(__pyx_t_3);
18370  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18371  __pyx_t_1 = 0;
18372  __pyx_t_2 = 0;
18373  __pyx_t_3 = 0;
18374 
18375  /* "View.MemoryView":1253
18376  * cdef int _err_extents(int i, Py_ssize_t extent1,
18377  * Py_ssize_t extent2) except -1 with gil:
18378  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
18379  * (i, extent1, extent2))
18380  *
18381  */
18382  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
18383  __Pyx_GOTREF(__pyx_t_3);
18384  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18385  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
18386  __Pyx_GOTREF(__pyx_t_4);
18387  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18388  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18389  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18390  __PYX_ERR(1, 1253, __pyx_L1_error)
18391 
18392  /* "View.MemoryView":1251
18393  *
18394  * @cname('__pyx_memoryview_err_extents')
18395  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18396  * Py_ssize_t extent2) except -1 with gil:
18397  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18398  */
18399 
18400  /* function exit code */
18401  __pyx_L1_error:;
18402  __Pyx_XDECREF(__pyx_t_1);
18403  __Pyx_XDECREF(__pyx_t_2);
18404  __Pyx_XDECREF(__pyx_t_3);
18405  __Pyx_XDECREF(__pyx_t_4);
18406  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18407  __pyx_r = -1;
18408  __Pyx_RefNannyFinishContext();
18409  #ifdef WITH_THREAD
18410  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18411  #endif
18412  return __pyx_r;
18413 }
18414 
18415 /* "View.MemoryView":1257
18416  *
18417  * @cname('__pyx_memoryview_err_dim')
18418  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18419  * raise error(msg.decode('ascii') % dim)
18420  *
18421  */
18422 
18423 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
18424  int __pyx_r;
18425  __Pyx_RefNannyDeclarations
18426  PyObject *__pyx_t_1 = NULL;
18427  PyObject *__pyx_t_2 = NULL;
18428  PyObject *__pyx_t_3 = NULL;
18429  PyObject *__pyx_t_4 = NULL;
18430  int __pyx_lineno = 0;
18431  const char *__pyx_filename = NULL;
18432  int __pyx_clineno = 0;
18433  #ifdef WITH_THREAD
18434  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18435  #endif
18436  __Pyx_RefNannySetupContext("_err_dim", 0);
18437  __Pyx_INCREF(__pyx_v_error);
18438 
18439  /* "View.MemoryView":1258
18440  * @cname('__pyx_memoryview_err_dim')
18441  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
18442  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
18443  *
18444  * @cname('__pyx_memoryview_err')
18445  */
18446  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
18447  __Pyx_GOTREF(__pyx_t_2);
18448  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
18449  __Pyx_GOTREF(__pyx_t_3);
18450  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
18451  __Pyx_GOTREF(__pyx_t_4);
18452  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18453  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18454  __Pyx_INCREF(__pyx_v_error);
18455  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
18456  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18457  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
18458  if (likely(__pyx_t_2)) {
18459  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
18460  __Pyx_INCREF(__pyx_t_2);
18461  __Pyx_INCREF(function);
18462  __Pyx_DECREF_SET(__pyx_t_3, function);
18463  }
18464  }
18465  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
18466  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18467  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18468  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
18469  __Pyx_GOTREF(__pyx_t_1);
18470  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18471  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18472  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18473  __PYX_ERR(1, 1258, __pyx_L1_error)
18474 
18475  /* "View.MemoryView":1257
18476  *
18477  * @cname('__pyx_memoryview_err_dim')
18478  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18479  * raise error(msg.decode('ascii') % dim)
18480  *
18481  */
18482 
18483  /* function exit code */
18484  __pyx_L1_error:;
18485  __Pyx_XDECREF(__pyx_t_1);
18486  __Pyx_XDECREF(__pyx_t_2);
18487  __Pyx_XDECREF(__pyx_t_3);
18488  __Pyx_XDECREF(__pyx_t_4);
18489  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
18490  __pyx_r = -1;
18491  __Pyx_XDECREF(__pyx_v_error);
18492  __Pyx_RefNannyFinishContext();
18493  #ifdef WITH_THREAD
18494  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18495  #endif
18496  return __pyx_r;
18497 }
18498 
18499 /* "View.MemoryView":1261
18500  *
18501  * @cname('__pyx_memoryview_err')
18502  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
18503  * if msg != NULL:
18504  * raise error(msg.decode('ascii'))
18505  */
18506 
18507 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
18508  int __pyx_r;
18509  __Pyx_RefNannyDeclarations
18510  int __pyx_t_1;
18511  PyObject *__pyx_t_2 = NULL;
18512  PyObject *__pyx_t_3 = NULL;
18513  PyObject *__pyx_t_4 = NULL;
18514  PyObject *__pyx_t_5 = NULL;
18515  int __pyx_lineno = 0;
18516  const char *__pyx_filename = NULL;
18517  int __pyx_clineno = 0;
18518  #ifdef WITH_THREAD
18519  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18520  #endif
18521  __Pyx_RefNannySetupContext("_err", 0);
18522  __Pyx_INCREF(__pyx_v_error);
18523 
18524  /* "View.MemoryView":1262
18525  * @cname('__pyx_memoryview_err')
18526  * cdef int _err(object error, char *msg) except -1 with gil:
18527  * if msg != NULL: # <<<<<<<<<<<<<<
18528  * raise error(msg.decode('ascii'))
18529  * else:
18530  */
18531  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
18532  if (unlikely(__pyx_t_1)) {
18533 
18534  /* "View.MemoryView":1263
18535  * cdef int _err(object error, char *msg) except -1 with gil:
18536  * if msg != NULL:
18537  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
18538  * else:
18539  * raise error
18540  */
18541  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
18542  __Pyx_GOTREF(__pyx_t_3);
18543  __Pyx_INCREF(__pyx_v_error);
18544  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
18545  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
18546  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
18547  if (likely(__pyx_t_5)) {
18548  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
18549  __Pyx_INCREF(__pyx_t_5);
18550  __Pyx_INCREF(function);
18551  __Pyx_DECREF_SET(__pyx_t_4, function);
18552  }
18553  }
18554  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
18555  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18556  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18557  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
18558  __Pyx_GOTREF(__pyx_t_2);
18559  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18560  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
18561  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18562  __PYX_ERR(1, 1263, __pyx_L1_error)
18563 
18564  /* "View.MemoryView":1262
18565  * @cname('__pyx_memoryview_err')
18566  * cdef int _err(object error, char *msg) except -1 with gil:
18567  * if msg != NULL: # <<<<<<<<<<<<<<
18568  * raise error(msg.decode('ascii'))
18569  * else:
18570  */
18571  }
18572 
18573  /* "View.MemoryView":1265
18574  * raise error(msg.decode('ascii'))
18575  * else:
18576  * raise error # <<<<<<<<<<<<<<
18577  *
18578  * @cname('__pyx_memoryview_copy_contents')
18579  */
18580  /*else*/ {
18581  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
18582  __PYX_ERR(1, 1265, __pyx_L1_error)
18583  }
18584 
18585  /* "View.MemoryView":1261
18586  *
18587  * @cname('__pyx_memoryview_err')
18588  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
18589  * if msg != NULL:
18590  * raise error(msg.decode('ascii'))
18591  */
18592 
18593  /* function exit code */
18594  __pyx_L1_error:;
18595  __Pyx_XDECREF(__pyx_t_2);
18596  __Pyx_XDECREF(__pyx_t_3);
18597  __Pyx_XDECREF(__pyx_t_4);
18598  __Pyx_XDECREF(__pyx_t_5);
18599  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
18600  __pyx_r = -1;
18601  __Pyx_XDECREF(__pyx_v_error);
18602  __Pyx_RefNannyFinishContext();
18603  #ifdef WITH_THREAD
18604  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18605  #endif
18606  return __pyx_r;
18607 }
18608 
18609 /* "View.MemoryView":1268
18610  *
18611  * @cname('__pyx_memoryview_copy_contents')
18612  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
18613  * __Pyx_memviewslice dst,
18614  * int src_ndim, int dst_ndim,
18615  */
18616 
18617 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
18618  void *__pyx_v_tmpdata;
18619  size_t __pyx_v_itemsize;
18620  int __pyx_v_i;
18621  char __pyx_v_order;
18622  int __pyx_v_broadcasting;
18623  int __pyx_v_direct_copy;
18624  __Pyx_memviewslice __pyx_v_tmp;
18625  int __pyx_v_ndim;
18626  int __pyx_r;
18627  Py_ssize_t __pyx_t_1;
18628  int __pyx_t_2;
18629  int __pyx_t_3;
18630  int __pyx_t_4;
18631  int __pyx_t_5;
18632  int __pyx_t_6;
18633  void *__pyx_t_7;
18634  int __pyx_t_8;
18635  int __pyx_lineno = 0;
18636  const char *__pyx_filename = NULL;
18637  int __pyx_clineno = 0;
18638 
18639  /* "View.MemoryView":1276
18640  * Check for overlapping memory and verify the shapes.
18641  * """
18642  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
18643  * cdef size_t itemsize = src.memview.view.itemsize
18644  * cdef int i
18645  */
18646  __pyx_v_tmpdata = NULL;
18647 
18648  /* "View.MemoryView":1277
18649  * """
18650  * cdef void *tmpdata = NULL
18651  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18652  * cdef int i
18653  * cdef char order = get_best_order(&src, src_ndim)
18654  */
18655  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
18656  __pyx_v_itemsize = __pyx_t_1;
18657 
18658  /* "View.MemoryView":1279
18659  * cdef size_t itemsize = src.memview.view.itemsize
18660  * cdef int i
18661  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
18662  * cdef bint broadcasting = False
18663  * cdef bint direct_copy = False
18664  */
18665  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
18666 
18667  /* "View.MemoryView":1280
18668  * cdef int i
18669  * cdef char order = get_best_order(&src, src_ndim)
18670  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
18671  * cdef bint direct_copy = False
18672  * cdef __Pyx_memviewslice tmp
18673  */
18674  __pyx_v_broadcasting = 0;
18675 
18676  /* "View.MemoryView":1281
18677  * cdef char order = get_best_order(&src, src_ndim)
18678  * cdef bint broadcasting = False
18679  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
18680  * cdef __Pyx_memviewslice tmp
18681  *
18682  */
18683  __pyx_v_direct_copy = 0;
18684 
18685  /* "View.MemoryView":1284
18686  * cdef __Pyx_memviewslice tmp
18687  *
18688  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
18689  * broadcast_leading(&src, src_ndim, dst_ndim)
18690  * elif dst_ndim < src_ndim:
18691  */
18692  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
18693  if (__pyx_t_2) {
18694 
18695  /* "View.MemoryView":1285
18696  *
18697  * if src_ndim < dst_ndim:
18698  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
18699  * elif dst_ndim < src_ndim:
18700  * broadcast_leading(&dst, dst_ndim, src_ndim)
18701  */
18702  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
18703 
18704  /* "View.MemoryView":1284
18705  * cdef __Pyx_memviewslice tmp
18706  *
18707  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
18708  * broadcast_leading(&src, src_ndim, dst_ndim)
18709  * elif dst_ndim < src_ndim:
18710  */
18711  goto __pyx_L3;
18712  }
18713 
18714  /* "View.MemoryView":1286
18715  * if src_ndim < dst_ndim:
18716  * broadcast_leading(&src, src_ndim, dst_ndim)
18717  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
18718  * broadcast_leading(&dst, dst_ndim, src_ndim)
18719  *
18720  */
18721  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
18722  if (__pyx_t_2) {
18723 
18724  /* "View.MemoryView":1287
18725  * broadcast_leading(&src, src_ndim, dst_ndim)
18726  * elif dst_ndim < src_ndim:
18727  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
18728  *
18729  * cdef int ndim = max(src_ndim, dst_ndim)
18730  */
18731  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
18732 
18733  /* "View.MemoryView":1286
18734  * if src_ndim < dst_ndim:
18735  * broadcast_leading(&src, src_ndim, dst_ndim)
18736  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
18737  * broadcast_leading(&dst, dst_ndim, src_ndim)
18738  *
18739  */
18740  }
18741  __pyx_L3:;
18742 
18743  /* "View.MemoryView":1289
18744  * broadcast_leading(&dst, dst_ndim, src_ndim)
18745  *
18746  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
18747  *
18748  * for i in range(ndim):
18749  */
18750  __pyx_t_3 = __pyx_v_dst_ndim;
18751  __pyx_t_4 = __pyx_v_src_ndim;
18752  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
18753  __pyx_t_5 = __pyx_t_3;
18754  } else {
18755  __pyx_t_5 = __pyx_t_4;
18756  }
18757  __pyx_v_ndim = __pyx_t_5;
18758 
18759  /* "View.MemoryView":1291
18760  * cdef int ndim = max(src_ndim, dst_ndim)
18761  *
18762  * for i in range(ndim): # <<<<<<<<<<<<<<
18763  * if src.shape[i] != dst.shape[i]:
18764  * if src.shape[i] == 1:
18765  */
18766  __pyx_t_5 = __pyx_v_ndim;
18767  __pyx_t_3 = __pyx_t_5;
18768  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18769  __pyx_v_i = __pyx_t_4;
18770 
18771  /* "View.MemoryView":1292
18772  *
18773  * for i in range(ndim):
18774  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
18775  * if src.shape[i] == 1:
18776  * broadcasting = True
18777  */
18778  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
18779  if (__pyx_t_2) {
18780 
18781  /* "View.MemoryView":1293
18782  * for i in range(ndim):
18783  * if src.shape[i] != dst.shape[i]:
18784  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
18785  * broadcasting = True
18786  * src.strides[i] = 0
18787  */
18788  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
18789  if (__pyx_t_2) {
18790 
18791  /* "View.MemoryView":1294
18792  * if src.shape[i] != dst.shape[i]:
18793  * if src.shape[i] == 1:
18794  * broadcasting = True # <<<<<<<<<<<<<<
18795  * src.strides[i] = 0
18796  * else:
18797  */
18798  __pyx_v_broadcasting = 1;
18799 
18800  /* "View.MemoryView":1295
18801  * if src.shape[i] == 1:
18802  * broadcasting = True
18803  * src.strides[i] = 0 # <<<<<<<<<<<<<<
18804  * else:
18805  * _err_extents(i, dst.shape[i], src.shape[i])
18806  */
18807  (__pyx_v_src.strides[__pyx_v_i]) = 0;
18808 
18809  /* "View.MemoryView":1293
18810  * for i in range(ndim):
18811  * if src.shape[i] != dst.shape[i]:
18812  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
18813  * broadcasting = True
18814  * src.strides[i] = 0
18815  */
18816  goto __pyx_L7;
18817  }
18818 
18819  /* "View.MemoryView":1297
18820  * src.strides[i] = 0
18821  * else:
18822  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
18823  *
18824  * if src.suboffsets[i] >= 0:
18825  */
18826  /*else*/ {
18827  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
18828  }
18829  __pyx_L7:;
18830 
18831  /* "View.MemoryView":1292
18832  *
18833  * for i in range(ndim):
18834  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
18835  * if src.shape[i] == 1:
18836  * broadcasting = True
18837  */
18838  }
18839 
18840  /* "View.MemoryView":1299
18841  * _err_extents(i, dst.shape[i], src.shape[i])
18842  *
18843  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18844  * _err_dim(ValueError, "Dimension %d is not direct", i)
18845  *
18846  */
18847  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
18848  if (__pyx_t_2) {
18849 
18850  /* "View.MemoryView":1300
18851  *
18852  * if src.suboffsets[i] >= 0:
18853  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
18854  *
18855  * if slices_overlap(&src, &dst, ndim, itemsize):
18856  */
18857  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
18858 
18859  /* "View.MemoryView":1299
18860  * _err_extents(i, dst.shape[i], src.shape[i])
18861  *
18862  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18863  * _err_dim(ValueError, "Dimension %d is not direct", i)
18864  *
18865  */
18866  }
18867  }
18868 
18869  /* "View.MemoryView":1302
18870  * _err_dim(ValueError, "Dimension %d is not direct", i)
18871  *
18872  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18873  *
18874  * if not slice_is_contig(src, order, ndim):
18875  */
18876  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
18877  if (__pyx_t_2) {
18878 
18879  /* "View.MemoryView":1304
18880  * if slices_overlap(&src, &dst, ndim, itemsize):
18881  *
18882  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18883  * order = get_best_order(&dst, ndim)
18884  *
18885  */
18886  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
18887  if (__pyx_t_2) {
18888 
18889  /* "View.MemoryView":1305
18890  *
18891  * if not slice_is_contig(src, order, ndim):
18892  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
18893  *
18894  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18895  */
18896  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
18897 
18898  /* "View.MemoryView":1304
18899  * if slices_overlap(&src, &dst, ndim, itemsize):
18900  *
18901  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18902  * order = get_best_order(&dst, ndim)
18903  *
18904  */
18905  }
18906 
18907  /* "View.MemoryView":1307
18908  * order = get_best_order(&dst, ndim)
18909  *
18910  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
18911  * src = tmp
18912  *
18913  */
18914  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
18915  __pyx_v_tmpdata = __pyx_t_7;
18916 
18917  /* "View.MemoryView":1308
18918  *
18919  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18920  * src = tmp # <<<<<<<<<<<<<<
18921  *
18922  * if not broadcasting:
18923  */
18924  __pyx_v_src = __pyx_v_tmp;
18925 
18926  /* "View.MemoryView":1302
18927  * _err_dim(ValueError, "Dimension %d is not direct", i)
18928  *
18929  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18930  *
18931  * if not slice_is_contig(src, order, ndim):
18932  */
18933  }
18934 
18935  /* "View.MemoryView":1310
18936  * src = tmp
18937  *
18938  * if not broadcasting: # <<<<<<<<<<<<<<
18939  *
18940  *
18941  */
18942  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
18943  if (__pyx_t_2) {
18944 
18945  /* "View.MemoryView":1313
18946  *
18947  *
18948  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18949  * direct_copy = slice_is_contig(dst, 'C', ndim)
18950  * elif slice_is_contig(src, 'F', ndim):
18951  */
18952  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
18953  if (__pyx_t_2) {
18954 
18955  /* "View.MemoryView":1314
18956  *
18957  * if slice_is_contig(src, 'C', ndim):
18958  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
18959  * elif slice_is_contig(src, 'F', ndim):
18960  * direct_copy = slice_is_contig(dst, 'F', ndim)
18961  */
18962  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
18963 
18964  /* "View.MemoryView":1313
18965  *
18966  *
18967  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18968  * direct_copy = slice_is_contig(dst, 'C', ndim)
18969  * elif slice_is_contig(src, 'F', ndim):
18970  */
18971  goto __pyx_L12;
18972  }
18973 
18974  /* "View.MemoryView":1315
18975  * if slice_is_contig(src, 'C', ndim):
18976  * direct_copy = slice_is_contig(dst, 'C', ndim)
18977  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18978  * direct_copy = slice_is_contig(dst, 'F', ndim)
18979  *
18980  */
18981  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
18982  if (__pyx_t_2) {
18983 
18984  /* "View.MemoryView":1316
18985  * direct_copy = slice_is_contig(dst, 'C', ndim)
18986  * elif slice_is_contig(src, 'F', ndim):
18987  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
18988  *
18989  * if direct_copy:
18990  */
18991  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
18992 
18993  /* "View.MemoryView":1315
18994  * if slice_is_contig(src, 'C', ndim):
18995  * direct_copy = slice_is_contig(dst, 'C', ndim)
18996  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18997  * direct_copy = slice_is_contig(dst, 'F', ndim)
18998  *
18999  */
19000  }
19001  __pyx_L12:;
19002 
19003  /* "View.MemoryView":1318
19004  * direct_copy = slice_is_contig(dst, 'F', ndim)
19005  *
19006  * if direct_copy: # <<<<<<<<<<<<<<
19007  *
19008  * refcount_copying(&dst, dtype_is_object, ndim, False)
19009  */
19010  __pyx_t_2 = (__pyx_v_direct_copy != 0);
19011  if (__pyx_t_2) {
19012 
19013  /* "View.MemoryView":1320
19014  * if direct_copy:
19015  *
19016  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19017  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19018  * refcount_copying(&dst, dtype_is_object, ndim, True)
19019  */
19020  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19021 
19022  /* "View.MemoryView":1321
19023  *
19024  * refcount_copying(&dst, dtype_is_object, ndim, False)
19025  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
19026  * refcount_copying(&dst, dtype_is_object, ndim, True)
19027  * free(tmpdata)
19028  */
19029  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19030 
19031  /* "View.MemoryView":1322
19032  * refcount_copying(&dst, dtype_is_object, ndim, False)
19033  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19034  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19035  * free(tmpdata)
19036  * return 0
19037  */
19038  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19039 
19040  /* "View.MemoryView":1323
19041  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19042  * refcount_copying(&dst, dtype_is_object, ndim, True)
19043  * free(tmpdata) # <<<<<<<<<<<<<<
19044  * return 0
19045  *
19046  */
19047  free(__pyx_v_tmpdata);
19048 
19049  /* "View.MemoryView":1324
19050  * refcount_copying(&dst, dtype_is_object, ndim, True)
19051  * free(tmpdata)
19052  * return 0 # <<<<<<<<<<<<<<
19053  *
19054  * if order == 'F' == get_best_order(&dst, ndim):
19055  */
19056  __pyx_r = 0;
19057  goto __pyx_L0;
19058 
19059  /* "View.MemoryView":1318
19060  * direct_copy = slice_is_contig(dst, 'F', ndim)
19061  *
19062  * if direct_copy: # <<<<<<<<<<<<<<
19063  *
19064  * refcount_copying(&dst, dtype_is_object, ndim, False)
19065  */
19066  }
19067 
19068  /* "View.MemoryView":1310
19069  * src = tmp
19070  *
19071  * if not broadcasting: # <<<<<<<<<<<<<<
19072  *
19073  *
19074  */
19075  }
19076 
19077  /* "View.MemoryView":1326
19078  * return 0
19079  *
19080  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19081  *
19082  *
19083  */
19084  __pyx_t_2 = (__pyx_v_order == 'F');
19085  if (__pyx_t_2) {
19086  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19087  }
19088  __pyx_t_8 = (__pyx_t_2 != 0);
19089  if (__pyx_t_8) {
19090 
19091  /* "View.MemoryView":1329
19092  *
19093  *
19094  * transpose_memslice(&src) # <<<<<<<<<<<<<<
19095  * transpose_memslice(&dst)
19096  *
19097  */
19098  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
19099 
19100  /* "View.MemoryView":1330
19101  *
19102  * transpose_memslice(&src)
19103  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
19104  *
19105  * refcount_copying(&dst, dtype_is_object, ndim, False)
19106  */
19107  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
19108 
19109  /* "View.MemoryView":1326
19110  * return 0
19111  *
19112  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19113  *
19114  *
19115  */
19116  }
19117 
19118  /* "View.MemoryView":1332
19119  * transpose_memslice(&dst)
19120  *
19121  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19122  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19123  * refcount_copying(&dst, dtype_is_object, ndim, True)
19124  */
19125  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19126 
19127  /* "View.MemoryView":1333
19128  *
19129  * refcount_copying(&dst, dtype_is_object, ndim, False)
19130  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
19131  * refcount_copying(&dst, dtype_is_object, ndim, True)
19132  *
19133  */
19134  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19135 
19136  /* "View.MemoryView":1334
19137  * refcount_copying(&dst, dtype_is_object, ndim, False)
19138  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19139  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19140  *
19141  * free(tmpdata)
19142  */
19143  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19144 
19145  /* "View.MemoryView":1336
19146  * refcount_copying(&dst, dtype_is_object, ndim, True)
19147  *
19148  * free(tmpdata) # <<<<<<<<<<<<<<
19149  * return 0
19150  *
19151  */
19152  free(__pyx_v_tmpdata);
19153 
19154  /* "View.MemoryView":1337
19155  *
19156  * free(tmpdata)
19157  * return 0 # <<<<<<<<<<<<<<
19158  *
19159  * @cname('__pyx_memoryview_broadcast_leading')
19160  */
19161  __pyx_r = 0;
19162  goto __pyx_L0;
19163 
19164  /* "View.MemoryView":1268
19165  *
19166  * @cname('__pyx_memoryview_copy_contents')
19167  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19168  * __Pyx_memviewslice dst,
19169  * int src_ndim, int dst_ndim,
19170  */
19171 
19172  /* function exit code */
19173  __pyx_L1_error:;
19174  {
19175  #ifdef WITH_THREAD
19176  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19177  #endif
19178  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19179  #ifdef WITH_THREAD
19180  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19181  #endif
19182  }
19183  __pyx_r = -1;
19184  __pyx_L0:;
19185  return __pyx_r;
19186 }
19187 
19188 /* "View.MemoryView":1340
19189  *
19190  * @cname('__pyx_memoryview_broadcast_leading')
19191  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19192  * int ndim,
19193  * int ndim_other) nogil:
19194  */
19195 
19196 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
19197  int __pyx_v_i;
19198  int __pyx_v_offset;
19199  int __pyx_t_1;
19200  int __pyx_t_2;
19201  int __pyx_t_3;
19202 
19203  /* "View.MemoryView":1344
19204  * int ndim_other) nogil:
19205  * cdef int i
19206  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
19207  *
19208  * for i in range(ndim - 1, -1, -1):
19209  */
19210  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19211 
19212  /* "View.MemoryView":1346
19213  * cdef int offset = ndim_other - ndim
19214  *
19215  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19216  * mslice.shape[i + offset] = mslice.shape[i]
19217  * mslice.strides[i + offset] = mslice.strides[i]
19218  */
19219  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19220  __pyx_v_i = __pyx_t_1;
19221 
19222  /* "View.MemoryView":1347
19223  *
19224  * for i in range(ndim - 1, -1, -1):
19225  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
19226  * mslice.strides[i + offset] = mslice.strides[i]
19227  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19228  */
19229  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19230 
19231  /* "View.MemoryView":1348
19232  * for i in range(ndim - 1, -1, -1):
19233  * mslice.shape[i + offset] = mslice.shape[i]
19234  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
19235  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19236  *
19237  */
19238  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19239 
19240  /* "View.MemoryView":1349
19241  * mslice.shape[i + offset] = mslice.shape[i]
19242  * mslice.strides[i + offset] = mslice.strides[i]
19243  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
19244  *
19245  * for i in range(offset):
19246  */
19247  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19248  }
19249 
19250  /* "View.MemoryView":1351
19251  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19252  *
19253  * for i in range(offset): # <<<<<<<<<<<<<<
19254  * mslice.shape[i] = 1
19255  * mslice.strides[i] = mslice.strides[0]
19256  */
19257  __pyx_t_1 = __pyx_v_offset;
19258  __pyx_t_2 = __pyx_t_1;
19259  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19260  __pyx_v_i = __pyx_t_3;
19261 
19262  /* "View.MemoryView":1352
19263  *
19264  * for i in range(offset):
19265  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
19266  * mslice.strides[i] = mslice.strides[0]
19267  * mslice.suboffsets[i] = -1
19268  */
19269  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19270 
19271  /* "View.MemoryView":1353
19272  * for i in range(offset):
19273  * mslice.shape[i] = 1
19274  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
19275  * mslice.suboffsets[i] = -1
19276  *
19277  */
19278  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19279 
19280  /* "View.MemoryView":1354
19281  * mslice.shape[i] = 1
19282  * mslice.strides[i] = mslice.strides[0]
19283  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19284  *
19285  *
19286  */
19287  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19288  }
19289 
19290  /* "View.MemoryView":1340
19291  *
19292  * @cname('__pyx_memoryview_broadcast_leading')
19293  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19294  * int ndim,
19295  * int ndim_other) nogil:
19296  */
19297 
19298  /* function exit code */
19299 }
19300 
19301 /* "View.MemoryView":1362
19302  *
19303  * @cname('__pyx_memoryview_refcount_copying')
19304  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19305  * int ndim, bint inc) nogil:
19306  *
19307  */
19308 
19309 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
19310  int __pyx_t_1;
19311 
19312  /* "View.MemoryView":1366
19313  *
19314  *
19315  * if dtype_is_object: # <<<<<<<<<<<<<<
19316  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19317  * dst.strides, ndim, inc)
19318  */
19319  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19320  if (__pyx_t_1) {
19321 
19322  /* "View.MemoryView":1367
19323  *
19324  * if dtype_is_object:
19325  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
19326  * dst.strides, ndim, inc)
19327  *
19328  */
19329  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19330 
19331  /* "View.MemoryView":1366
19332  *
19333  *
19334  * if dtype_is_object: # <<<<<<<<<<<<<<
19335  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19336  * dst.strides, ndim, inc)
19337  */
19338  }
19339 
19340  /* "View.MemoryView":1362
19341  *
19342  * @cname('__pyx_memoryview_refcount_copying')
19343  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19344  * int ndim, bint inc) nogil:
19345  *
19346  */
19347 
19348  /* function exit code */
19349 }
19350 
19351 /* "View.MemoryView":1371
19352  *
19353  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19354  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19355  * Py_ssize_t *strides, int ndim,
19356  * bint inc) with gil:
19357  */
19358 
19359 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19360  __Pyx_RefNannyDeclarations
19361  #ifdef WITH_THREAD
19362  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19363  #endif
19364  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
19365 
19366  /* "View.MemoryView":1374
19367  * Py_ssize_t *strides, int ndim,
19368  * bint inc) with gil:
19369  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
19370  *
19371  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19372  */
19373  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19374 
19375  /* "View.MemoryView":1371
19376  *
19377  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19378  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19379  * Py_ssize_t *strides, int ndim,
19380  * bint inc) with gil:
19381  */
19382 
19383  /* function exit code */
19384  __Pyx_RefNannyFinishContext();
19385  #ifdef WITH_THREAD
19386  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19387  #endif
19388 }
19389 
19390 /* "View.MemoryView":1377
19391  *
19392  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19393  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19394  * Py_ssize_t *strides, int ndim, bint inc):
19395  * cdef Py_ssize_t i
19396  */
19397 
19398 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19399  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19400  __Pyx_RefNannyDeclarations
19401  Py_ssize_t __pyx_t_1;
19402  Py_ssize_t __pyx_t_2;
19403  Py_ssize_t __pyx_t_3;
19404  int __pyx_t_4;
19405  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
19406 
19407  /* "View.MemoryView":1381
19408  * cdef Py_ssize_t i
19409  *
19410  * for i in range(shape[0]): # <<<<<<<<<<<<<<
19411  * if ndim == 1:
19412  * if inc:
19413  */
19414  __pyx_t_1 = (__pyx_v_shape[0]);
19415  __pyx_t_2 = __pyx_t_1;
19416  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19417  __pyx_v_i = __pyx_t_3;
19418 
19419  /* "View.MemoryView":1382
19420  *
19421  * for i in range(shape[0]):
19422  * if ndim == 1: # <<<<<<<<<<<<<<
19423  * if inc:
19424  * Py_INCREF((<PyObject **> data)[0])
19425  */
19426  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
19427  if (__pyx_t_4) {
19428 
19429  /* "View.MemoryView":1383
19430  * for i in range(shape[0]):
19431  * if ndim == 1:
19432  * if inc: # <<<<<<<<<<<<<<
19433  * Py_INCREF((<PyObject **> data)[0])
19434  * else:
19435  */
19436  __pyx_t_4 = (__pyx_v_inc != 0);
19437  if (__pyx_t_4) {
19438 
19439  /* "View.MemoryView":1384
19440  * if ndim == 1:
19441  * if inc:
19442  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
19443  * else:
19444  * Py_DECREF((<PyObject **> data)[0])
19445  */
19446  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
19447 
19448  /* "View.MemoryView":1383
19449  * for i in range(shape[0]):
19450  * if ndim == 1:
19451  * if inc: # <<<<<<<<<<<<<<
19452  * Py_INCREF((<PyObject **> data)[0])
19453  * else:
19454  */
19455  goto __pyx_L6;
19456  }
19457 
19458  /* "View.MemoryView":1386
19459  * Py_INCREF((<PyObject **> data)[0])
19460  * else:
19461  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
19462  * else:
19463  * refcount_objects_in_slice(data, shape + 1, strides + 1,
19464  */
19465  /*else*/ {
19466  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
19467  }
19468  __pyx_L6:;
19469 
19470  /* "View.MemoryView":1382
19471  *
19472  * for i in range(shape[0]):
19473  * if ndim == 1: # <<<<<<<<<<<<<<
19474  * if inc:
19475  * Py_INCREF((<PyObject **> data)[0])
19476  */
19477  goto __pyx_L5;
19478  }
19479 
19480  /* "View.MemoryView":1388
19481  * Py_DECREF((<PyObject **> data)[0])
19482  * else:
19483  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
19484  * ndim - 1, inc)
19485  *
19486  */
19487  /*else*/ {
19488 
19489  /* "View.MemoryView":1389
19490  * else:
19491  * refcount_objects_in_slice(data, shape + 1, strides + 1,
19492  * ndim - 1, inc) # <<<<<<<<<<<<<<
19493  *
19494  * data += strides[0]
19495  */
19496  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
19497  }
19498  __pyx_L5:;
19499 
19500  /* "View.MemoryView":1391
19501  * ndim - 1, inc)
19502  *
19503  * data += strides[0] # <<<<<<<<<<<<<<
19504  *
19505  *
19506  */
19507  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
19508  }
19509 
19510  /* "View.MemoryView":1377
19511  *
19512  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19513  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19514  * Py_ssize_t *strides, int ndim, bint inc):
19515  * cdef Py_ssize_t i
19516  */
19517 
19518  /* function exit code */
19519  __Pyx_RefNannyFinishContext();
19520 }
19521 
19522 /* "View.MemoryView":1397
19523  *
19524  * @cname('__pyx_memoryview_slice_assign_scalar')
19525  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
19526  * size_t itemsize, void *item,
19527  * bint dtype_is_object) nogil:
19528  */
19529 
19530 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
19531 
19532  /* "View.MemoryView":1400
19533  * size_t itemsize, void *item,
19534  * bint dtype_is_object) nogil:
19535  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19536  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
19537  * itemsize, item)
19538  */
19539  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19540 
19541  /* "View.MemoryView":1401
19542  * bint dtype_is_object) nogil:
19543  * refcount_copying(dst, dtype_is_object, ndim, False)
19544  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
19545  * itemsize, item)
19546  * refcount_copying(dst, dtype_is_object, ndim, True)
19547  */
19548  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
19549 
19550  /* "View.MemoryView":1403
19551  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
19552  * itemsize, item)
19553  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19554  *
19555  *
19556  */
19557  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19558 
19559  /* "View.MemoryView":1397
19560  *
19561  * @cname('__pyx_memoryview_slice_assign_scalar')
19562  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
19563  * size_t itemsize, void *item,
19564  * bint dtype_is_object) nogil:
19565  */
19566 
19567  /* function exit code */
19568 }
19569 
19570 /* "View.MemoryView":1407
19571  *
19572  * @cname('__pyx_memoryview__slice_assign_scalar')
19573  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19574  * Py_ssize_t *strides, int ndim,
19575  * size_t itemsize, void *item) nogil:
19576  */
19577 
19578 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
19579  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19580  Py_ssize_t __pyx_v_stride;
19581  Py_ssize_t __pyx_v_extent;
19582  int __pyx_t_1;
19583  Py_ssize_t __pyx_t_2;
19584  Py_ssize_t __pyx_t_3;
19585  Py_ssize_t __pyx_t_4;
19586 
19587  /* "View.MemoryView":1411
19588  * size_t itemsize, void *item) nogil:
19589  * cdef Py_ssize_t i
19590  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
19591  * cdef Py_ssize_t extent = shape[0]
19592  *
19593  */
19594  __pyx_v_stride = (__pyx_v_strides[0]);
19595 
19596  /* "View.MemoryView":1412
19597  * cdef Py_ssize_t i
19598  * cdef Py_ssize_t stride = strides[0]
19599  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
19600  *
19601  * if ndim == 1:
19602  */
19603  __pyx_v_extent = (__pyx_v_shape[0]);
19604 
19605  /* "View.MemoryView":1414
19606  * cdef Py_ssize_t extent = shape[0]
19607  *
19608  * if ndim == 1: # <<<<<<<<<<<<<<
19609  * for i in range(extent):
19610  * memcpy(data, item, itemsize)
19611  */
19612  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19613  if (__pyx_t_1) {
19614 
19615  /* "View.MemoryView":1415
19616  *
19617  * if ndim == 1:
19618  * for i in range(extent): # <<<<<<<<<<<<<<
19619  * memcpy(data, item, itemsize)
19620  * data += stride
19621  */
19622  __pyx_t_2 = __pyx_v_extent;
19623  __pyx_t_3 = __pyx_t_2;
19624  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19625  __pyx_v_i = __pyx_t_4;
19626 
19627  /* "View.MemoryView":1416
19628  * if ndim == 1:
19629  * for i in range(extent):
19630  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
19631  * data += stride
19632  * else:
19633  */
19634  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
19635 
19636  /* "View.MemoryView":1417
19637  * for i in range(extent):
19638  * memcpy(data, item, itemsize)
19639  * data += stride # <<<<<<<<<<<<<<
19640  * else:
19641  * for i in range(extent):
19642  */
19643  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19644  }
19645 
19646  /* "View.MemoryView":1414
19647  * cdef Py_ssize_t extent = shape[0]
19648  *
19649  * if ndim == 1: # <<<<<<<<<<<<<<
19650  * for i in range(extent):
19651  * memcpy(data, item, itemsize)
19652  */
19653  goto __pyx_L3;
19654  }
19655 
19656  /* "View.MemoryView":1419
19657  * data += stride
19658  * else:
19659  * for i in range(extent): # <<<<<<<<<<<<<<
19660  * _slice_assign_scalar(data, shape + 1, strides + 1,
19661  * ndim - 1, itemsize, item)
19662  */
19663  /*else*/ {
19664  __pyx_t_2 = __pyx_v_extent;
19665  __pyx_t_3 = __pyx_t_2;
19666  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19667  __pyx_v_i = __pyx_t_4;
19668 
19669  /* "View.MemoryView":1420
19670  * else:
19671  * for i in range(extent):
19672  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
19673  * ndim - 1, itemsize, item)
19674  * data += stride
19675  */
19676  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
19677 
19678  /* "View.MemoryView":1422
19679  * _slice_assign_scalar(data, shape + 1, strides + 1,
19680  * ndim - 1, itemsize, item)
19681  * data += stride # <<<<<<<<<<<<<<
19682  *
19683  *
19684  */
19685  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19686  }
19687  }
19688  __pyx_L3:;
19689 
19690  /* "View.MemoryView":1407
19691  *
19692  * @cname('__pyx_memoryview__slice_assign_scalar')
19693  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19694  * Py_ssize_t *strides, int ndim,
19695  * size_t itemsize, void *item) nogil:
19696  */
19697 
19698  /* function exit code */
19699 }
19700 
19701 /* "(tree fragment)":1
19702  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19703  * cdef object __pyx_PickleError
19704  * cdef object __pyx_result
19705  */
19706 
19707 /* Python wrapper */
19708 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19709 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
19710 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19711  PyObject *__pyx_v___pyx_type = 0;
19712  long __pyx_v___pyx_checksum;
19713  PyObject *__pyx_v___pyx_state = 0;
19714  int __pyx_lineno = 0;
19715  const char *__pyx_filename = NULL;
19716  int __pyx_clineno = 0;
19717  PyObject *__pyx_r = 0;
19718  __Pyx_RefNannyDeclarations
19719  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
19720  {
19721  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
19722  PyObject* values[3] = {0,0,0};
19723  if (unlikely(__pyx_kwds)) {
19724  Py_ssize_t kw_args;
19725  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19726  switch (pos_args) {
19727  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19728  CYTHON_FALLTHROUGH;
19729  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19730  CYTHON_FALLTHROUGH;
19731  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19732  CYTHON_FALLTHROUGH;
19733  case 0: break;
19734  default: goto __pyx_L5_argtuple_error;
19735  }
19736  kw_args = PyDict_Size(__pyx_kwds);
19737  switch (pos_args) {
19738  case 0:
19739  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
19740  else goto __pyx_L5_argtuple_error;
19741  CYTHON_FALLTHROUGH;
19742  case 1:
19743  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
19744  else {
19745  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
19746  }
19747  CYTHON_FALLTHROUGH;
19748  case 2:
19749  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
19750  else {
19751  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
19752  }
19753  }
19754  if (unlikely(kw_args > 0)) {
19755  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
19756  }
19757  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
19758  goto __pyx_L5_argtuple_error;
19759  } else {
19760  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19761  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19762  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19763  }
19764  __pyx_v___pyx_type = values[0];
19765  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
19766  __pyx_v___pyx_state = values[2];
19767  }
19768  goto __pyx_L4_argument_unpacking_done;
19769  __pyx_L5_argtuple_error:;
19770  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
19771  __pyx_L3_error:;
19772  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19773  __Pyx_RefNannyFinishContext();
19774  return NULL;
19775  __pyx_L4_argument_unpacking_done:;
19776  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
19777 
19778  /* function exit code */
19779  __Pyx_RefNannyFinishContext();
19780  return __pyx_r;
19781 }
19782 
19783 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
19784  PyObject *__pyx_v___pyx_PickleError = 0;
19785  PyObject *__pyx_v___pyx_result = 0;
19786  PyObject *__pyx_r = NULL;
19787  __Pyx_RefNannyDeclarations
19788  int __pyx_t_1;
19789  PyObject *__pyx_t_2 = NULL;
19790  PyObject *__pyx_t_3 = NULL;
19791  PyObject *__pyx_t_4 = NULL;
19792  PyObject *__pyx_t_5 = NULL;
19793  int __pyx_t_6;
19794  int __pyx_lineno = 0;
19795  const char *__pyx_filename = NULL;
19796  int __pyx_clineno = 0;
19797  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
19798 
19799  /* "(tree fragment)":4
19800  * cdef object __pyx_PickleError
19801  * cdef object __pyx_result
19802  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
19803  * from pickle import PickleError as __pyx_PickleError
19804  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
19805  */
19806  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
19807  if (__pyx_t_1) {
19808 
19809  /* "(tree fragment)":5
19810  * cdef object __pyx_result
19811  * if __pyx_checksum != 0xb068931:
19812  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
19813  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
19814  * __pyx_result = Enum.__new__(__pyx_type)
19815  */
19816  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
19817  __Pyx_GOTREF(__pyx_t_2);
19818  __Pyx_INCREF(__pyx_n_s_PickleError);
19819  __Pyx_GIVEREF(__pyx_n_s_PickleError);
19820  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
19821  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
19822  __Pyx_GOTREF(__pyx_t_3);
19823  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19824  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
19825  __Pyx_GOTREF(__pyx_t_2);
19826  __Pyx_INCREF(__pyx_t_2);
19827  __pyx_v___pyx_PickleError = __pyx_t_2;
19828  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19829  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19830 
19831  /* "(tree fragment)":6
19832  * if __pyx_checksum != 0xb068931:
19833  * from pickle import PickleError as __pyx_PickleError
19834  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
19835  * __pyx_result = Enum.__new__(__pyx_type)
19836  * if __pyx_state is not None:
19837  */
19838  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
19839  __Pyx_GOTREF(__pyx_t_2);
19840  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
19841  __Pyx_GOTREF(__pyx_t_4);
19842  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19843  __Pyx_INCREF(__pyx_v___pyx_PickleError);
19844  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
19845  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
19846  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
19847  if (likely(__pyx_t_5)) {
19848  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
19849  __Pyx_INCREF(__pyx_t_5);
19850  __Pyx_INCREF(function);
19851  __Pyx_DECREF_SET(__pyx_t_2, function);
19852  }
19853  }
19854  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
19855  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19856  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19857  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
19858  __Pyx_GOTREF(__pyx_t_3);
19859  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19860  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19861  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19862  __PYX_ERR(1, 6, __pyx_L1_error)
19863 
19864  /* "(tree fragment)":4
19865  * cdef object __pyx_PickleError
19866  * cdef object __pyx_result
19867  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
19868  * from pickle import PickleError as __pyx_PickleError
19869  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
19870  */
19871  }
19872 
19873  /* "(tree fragment)":7
19874  * from pickle import PickleError as __pyx_PickleError
19875  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
19876  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
19877  * if __pyx_state is not None:
19878  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19879  */
19880  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
19881  __Pyx_GOTREF(__pyx_t_2);
19882  __pyx_t_4 = NULL;
19883  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
19884  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
19885  if (likely(__pyx_t_4)) {
19886  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
19887  __Pyx_INCREF(__pyx_t_4);
19888  __Pyx_INCREF(function);
19889  __Pyx_DECREF_SET(__pyx_t_2, function);
19890  }
19891  }
19892  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
19893  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
19894  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
19895  __Pyx_GOTREF(__pyx_t_3);
19896  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19897  __pyx_v___pyx_result = __pyx_t_3;
19898  __pyx_t_3 = 0;
19899 
19900  /* "(tree fragment)":8
19901  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
19902  * __pyx_result = Enum.__new__(__pyx_type)
19903  * if __pyx_state is not None: # <<<<<<<<<<<<<<
19904  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19905  * return __pyx_result
19906  */
19907  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
19908  __pyx_t_6 = (__pyx_t_1 != 0);
19909  if (__pyx_t_6) {
19910 
19911  /* "(tree fragment)":9
19912  * __pyx_result = Enum.__new__(__pyx_type)
19913  * if __pyx_state is not None:
19914  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
19915  * return __pyx_result
19916  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19917  */
19918  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
19919  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
19920  __Pyx_GOTREF(__pyx_t_3);
19921  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19922 
19923  /* "(tree fragment)":8
19924  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
19925  * __pyx_result = Enum.__new__(__pyx_type)
19926  * if __pyx_state is not None: # <<<<<<<<<<<<<<
19927  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19928  * return __pyx_result
19929  */
19930  }
19931 
19932  /* "(tree fragment)":10
19933  * if __pyx_state is not None:
19934  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19935  * return __pyx_result # <<<<<<<<<<<<<<
19936  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19937  * __pyx_result.name = __pyx_state[0]
19938  */
19939  __Pyx_XDECREF(__pyx_r);
19940  __Pyx_INCREF(__pyx_v___pyx_result);
19941  __pyx_r = __pyx_v___pyx_result;
19942  goto __pyx_L0;
19943 
19944  /* "(tree fragment)":1
19945  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19946  * cdef object __pyx_PickleError
19947  * cdef object __pyx_result
19948  */
19949 
19950  /* function exit code */
19951  __pyx_L1_error:;
19952  __Pyx_XDECREF(__pyx_t_2);
19953  __Pyx_XDECREF(__pyx_t_3);
19954  __Pyx_XDECREF(__pyx_t_4);
19955  __Pyx_XDECREF(__pyx_t_5);
19956  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19957  __pyx_r = NULL;
19958  __pyx_L0:;
19959  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
19960  __Pyx_XDECREF(__pyx_v___pyx_result);
19961  __Pyx_XGIVEREF(__pyx_r);
19962  __Pyx_RefNannyFinishContext();
19963  return __pyx_r;
19964 }
19965 
19966 /* "(tree fragment)":11
19967  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19968  * return __pyx_result
19969  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
19970  * __pyx_result.name = __pyx_state[0]
19971  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19972  */
19973 
19974 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
19975  PyObject *__pyx_r = NULL;
19976  __Pyx_RefNannyDeclarations
19977  PyObject *__pyx_t_1 = NULL;
19978  int __pyx_t_2;
19979  Py_ssize_t __pyx_t_3;
19980  int __pyx_t_4;
19981  int __pyx_t_5;
19982  PyObject *__pyx_t_6 = NULL;
19983  PyObject *__pyx_t_7 = NULL;
19984  PyObject *__pyx_t_8 = NULL;
19985  int __pyx_lineno = 0;
19986  const char *__pyx_filename = NULL;
19987  int __pyx_clineno = 0;
19988  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
19989 
19990  /* "(tree fragment)":12
19991  * return __pyx_result
19992  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19993  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
19994  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19995  * __pyx_result.__dict__.update(__pyx_state[1])
19996  */
19997  if (unlikely(__pyx_v___pyx_state == Py_None)) {
19998  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19999  __PYX_ERR(1, 12, __pyx_L1_error)
20000  }
20001  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20002  __Pyx_GOTREF(__pyx_t_1);
20003  __Pyx_GIVEREF(__pyx_t_1);
20004  __Pyx_GOTREF(__pyx_v___pyx_result->name);
20005  __Pyx_DECREF(__pyx_v___pyx_result->name);
20006  __pyx_v___pyx_result->name = __pyx_t_1;
20007  __pyx_t_1 = 0;
20008 
20009  /* "(tree fragment)":13
20010  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20011  * __pyx_result.name = __pyx_state[0]
20012  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20013  * __pyx_result.__dict__.update(__pyx_state[1])
20014  */
20015  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20016  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20017  __PYX_ERR(1, 13, __pyx_L1_error)
20018  }
20019  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20020  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20021  if (__pyx_t_4) {
20022  } else {
20023  __pyx_t_2 = __pyx_t_4;
20024  goto __pyx_L4_bool_binop_done;
20025  }
20026  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20027  __pyx_t_5 = (__pyx_t_4 != 0);
20028  __pyx_t_2 = __pyx_t_5;
20029  __pyx_L4_bool_binop_done:;
20030  if (__pyx_t_2) {
20031 
20032  /* "(tree fragment)":14
20033  * __pyx_result.name = __pyx_state[0]
20034  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20035  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
20036  */
20037  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20038  __Pyx_GOTREF(__pyx_t_6);
20039  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
20040  __Pyx_GOTREF(__pyx_t_7);
20041  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20042  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20043  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20044  __PYX_ERR(1, 14, __pyx_L1_error)
20045  }
20046  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20047  __Pyx_GOTREF(__pyx_t_6);
20048  __pyx_t_8 = NULL;
20049  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20050  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20051  if (likely(__pyx_t_8)) {
20052  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20053  __Pyx_INCREF(__pyx_t_8);
20054  __Pyx_INCREF(function);
20055  __Pyx_DECREF_SET(__pyx_t_7, function);
20056  }
20057  }
20058  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
20059  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20060  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20061  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
20062  __Pyx_GOTREF(__pyx_t_1);
20063  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20064  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20065 
20066  /* "(tree fragment)":13
20067  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20068  * __pyx_result.name = __pyx_state[0]
20069  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20070  * __pyx_result.__dict__.update(__pyx_state[1])
20071  */
20072  }
20073 
20074  /* "(tree fragment)":11
20075  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20076  * return __pyx_result
20077  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20078  * __pyx_result.name = __pyx_state[0]
20079  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20080  */
20081 
20082  /* function exit code */
20083  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20084  goto __pyx_L0;
20085  __pyx_L1_error:;
20086  __Pyx_XDECREF(__pyx_t_1);
20087  __Pyx_XDECREF(__pyx_t_6);
20088  __Pyx_XDECREF(__pyx_t_7);
20089  __Pyx_XDECREF(__pyx_t_8);
20090  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20091  __pyx_r = 0;
20092  __pyx_L0:;
20093  __Pyx_XGIVEREF(__pyx_r);
20094  __Pyx_RefNannyFinishContext();
20095  return __pyx_r;
20096 }
20097 
20098 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
20099  PyObject *o;
20100  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20101  o = (*t->tp_alloc)(t, 0);
20102  } else {
20103  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20104  }
20105  if (unlikely(!o)) return 0;
20106  if (unlikely(__pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(o, a, k) < 0)) goto bad;
20107  return o;
20108  bad:
20109  Py_DECREF(o); o = 0;
20110  return NULL;
20111 }
20112 
20113 static void __pyx_tp_dealloc_15superluWrappers_cSparseMatrix(PyObject *o) {
20114  #if CYTHON_USE_TP_FINALIZE
20115  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
20116  if (PyObject_CallFinalizerFromDealloc(o)) return;
20117  }
20118  #endif
20119  (*Py_TYPE(o)->tp_free)(o);
20120 }
20121 
20122 static PyMethodDef __pyx_methods_15superluWrappers_cSparseMatrix[] = {
20123  {"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__, METH_NOARGS, 0},
20124  {"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__, METH_O, 0},
20125  {0, 0, 0, 0}
20126 };
20127 
20128 static PyTypeObject __pyx_type_15superluWrappers_cSparseMatrix = {
20129  PyVarObject_HEAD_INIT(0, 0)
20130  "superluWrappers.cSparseMatrix", /*tp_name*/
20131  sizeof(struct __pyx_obj_15superluWrappers_cSparseMatrix), /*tp_basicsize*/
20132  0, /*tp_itemsize*/
20133  __pyx_tp_dealloc_15superluWrappers_cSparseMatrix, /*tp_dealloc*/
20134  #if PY_VERSION_HEX < 0x030800b4
20135  0, /*tp_print*/
20136  #endif
20137  #if PY_VERSION_HEX >= 0x030800b4
20138  0, /*tp_vectorcall_offset*/
20139  #endif
20140  0, /*tp_getattr*/
20141  0, /*tp_setattr*/
20142  #if PY_MAJOR_VERSION < 3
20143  0, /*tp_compare*/
20144  #endif
20145  #if PY_MAJOR_VERSION >= 3
20146  0, /*tp_as_async*/
20147  #endif
20148  0, /*tp_repr*/
20149  0, /*tp_as_number*/
20150  0, /*tp_as_sequence*/
20151  0, /*tp_as_mapping*/
20152  0, /*tp_hash*/
20153  0, /*tp_call*/
20154  0, /*tp_str*/
20155  0, /*tp_getattro*/
20156  0, /*tp_setattro*/
20157  0, /*tp_as_buffer*/
20158  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
20159  0, /*tp_doc*/
20160  0, /*tp_traverse*/
20161  0, /*tp_clear*/
20162  0, /*tp_richcompare*/
20163  0, /*tp_weaklistoffset*/
20164  0, /*tp_iter*/
20165  0, /*tp_iternext*/
20166  __pyx_methods_15superluWrappers_cSparseMatrix, /*tp_methods*/
20167  0, /*tp_members*/
20168  0, /*tp_getset*/
20169  0, /*tp_base*/
20170  0, /*tp_dict*/
20171  0, /*tp_descr_get*/
20172  0, /*tp_descr_set*/
20173  0, /*tp_dictoffset*/
20174  0, /*tp_init*/
20175  0, /*tp_alloc*/
20176  __pyx_tp_new_15superluWrappers_cSparseMatrix, /*tp_new*/
20177  0, /*tp_free*/
20178  0, /*tp_is_gc*/
20179  0, /*tp_bases*/
20180  0, /*tp_mro*/
20181  0, /*tp_cache*/
20182  0, /*tp_subclasses*/
20183  0, /*tp_weaklist*/
20184  0, /*tp_del*/
20185  0, /*tp_version_tag*/
20186  #if PY_VERSION_HEX >= 0x030400a1
20187  0, /*tp_finalize*/
20188  #endif
20189  #if PY_VERSION_HEX >= 0x030800b1
20190  0, /*tp_vectorcall*/
20191  #endif
20192  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20193  0, /*tp_print*/
20194  #endif
20195 };
20196 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor __pyx_vtable_15superluWrappers_SparseFactor;
20197 
20198 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20199  struct __pyx_obj_15superluWrappers_SparseFactor *p;
20200  PyObject *o;
20201  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20202  o = (*t->tp_alloc)(t, 0);
20203  } else {
20204  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20205  }
20206  if (unlikely(!o)) return 0;
20207  p = ((struct __pyx_obj_15superluWrappers_SparseFactor *)o);
20208  p->__pyx_vtab = __pyx_vtabptr_15superluWrappers_SparseFactor;
20209  return o;
20210 }
20211 
20212 static void __pyx_tp_dealloc_15superluWrappers_SparseFactor(PyObject *o) {
20213  #if CYTHON_USE_TP_FINALIZE
20214  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
20215  if (PyObject_CallFinalizerFromDealloc(o)) return;
20216  }
20217  #endif
20218  (*Py_TYPE(o)->tp_free)(o);
20219 }
20220 
20221 static PyObject *__pyx_getprop_15superluWrappers_12SparseFactor_dim(PyObject *o, CYTHON_UNUSED void *x) {
20222  return __pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(o);
20223 }
20224 
20225 static int __pyx_setprop_15superluWrappers_12SparseFactor_dim(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20226  if (v) {
20227  return __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(o, v);
20228  }
20229  else {
20230  PyErr_SetString(PyExc_NotImplementedError, "__del__");
20231  return -1;
20232  }
20233 }
20234 
20235 static PyMethodDef __pyx_methods_15superluWrappers_SparseFactor[] = {
20236  {"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__, METH_NOARGS, 0},
20237  {"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__, METH_O, 0},
20238  {0, 0, 0, 0}
20239 };
20240 
20241 static struct PyGetSetDef __pyx_getsets_15superluWrappers_SparseFactor[] = {
20242  {(char *)"dim", __pyx_getprop_15superluWrappers_12SparseFactor_dim, __pyx_setprop_15superluWrappers_12SparseFactor_dim, (char *)0, 0},
20243  {0, 0, 0, 0, 0}
20244 };
20245 
20246 static PyTypeObject __pyx_type_15superluWrappers_SparseFactor = {
20247  PyVarObject_HEAD_INIT(0, 0)
20248  "superluWrappers.SparseFactor", /*tp_name*/
20249  sizeof(struct __pyx_obj_15superluWrappers_SparseFactor), /*tp_basicsize*/
20250  0, /*tp_itemsize*/
20251  __pyx_tp_dealloc_15superluWrappers_SparseFactor, /*tp_dealloc*/
20252  #if PY_VERSION_HEX < 0x030800b4
20253  0, /*tp_print*/
20254  #endif
20255  #if PY_VERSION_HEX >= 0x030800b4
20256  0, /*tp_vectorcall_offset*/
20257  #endif
20258  0, /*tp_getattr*/
20259  0, /*tp_setattr*/
20260  #if PY_MAJOR_VERSION < 3
20261  0, /*tp_compare*/
20262  #endif
20263  #if PY_MAJOR_VERSION >= 3
20264  0, /*tp_as_async*/
20265  #endif
20266  0, /*tp_repr*/
20267  0, /*tp_as_number*/
20268  0, /*tp_as_sequence*/
20269  0, /*tp_as_mapping*/
20270  0, /*tp_hash*/
20271  0, /*tp_call*/
20272  0, /*tp_str*/
20273  0, /*tp_getattro*/
20274  0, /*tp_setattro*/
20275  0, /*tp_as_buffer*/
20276  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
20277  0, /*tp_doc*/
20278  0, /*tp_traverse*/
20279  0, /*tp_clear*/
20280  0, /*tp_richcompare*/
20281  0, /*tp_weaklistoffset*/
20282  0, /*tp_iter*/
20283  0, /*tp_iternext*/
20284  __pyx_methods_15superluWrappers_SparseFactor, /*tp_methods*/
20285  0, /*tp_members*/
20286  __pyx_getsets_15superluWrappers_SparseFactor, /*tp_getset*/
20287  0, /*tp_base*/
20288  0, /*tp_dict*/
20289  0, /*tp_descr_get*/
20290  0, /*tp_descr_set*/
20291  0, /*tp_dictoffset*/
20292  __pyx_pw_15superluWrappers_12SparseFactor_1__init__, /*tp_init*/
20293  0, /*tp_alloc*/
20294  __pyx_tp_new_15superluWrappers_SparseFactor, /*tp_new*/
20295  0, /*tp_free*/
20296  0, /*tp_is_gc*/
20297  0, /*tp_bases*/
20298  0, /*tp_mro*/
20299  0, /*tp_cache*/
20300  0, /*tp_subclasses*/
20301  0, /*tp_weaklist*/
20302  0, /*tp_del*/
20303  0, /*tp_version_tag*/
20304  #if PY_VERSION_HEX >= 0x030400a1
20305  0, /*tp_finalize*/
20306  #endif
20307  #if PY_VERSION_HEX >= 0x030800b1
20308  0, /*tp_vectorcall*/
20309  #endif
20310  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20311  0, /*tp_print*/
20312  #endif
20313 };
20314 static struct __pyx_vtabstruct_array __pyx_vtable_array;
20315 
20316 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
20317  struct __pyx_array_obj *p;
20318  PyObject *o;
20319  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20320  o = (*t->tp_alloc)(t, 0);
20321  } else {
20322  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20323  }
20324  if (unlikely(!o)) return 0;
20325  p = ((struct __pyx_array_obj *)o);
20326  p->__pyx_vtab = __pyx_vtabptr_array;
20327  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
20328  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
20329  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
20330  return o;
20331  bad:
20332  Py_DECREF(o); o = 0;
20333  return NULL;
20334 }
20335 
20336 static void __pyx_tp_dealloc_array(PyObject *o) {
20337  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
20338  #if CYTHON_USE_TP_FINALIZE
20339  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
20340  if (PyObject_CallFinalizerFromDealloc(o)) return;
20341  }
20342  #endif
20343  {
20344  PyObject *etype, *eval, *etb;
20345  PyErr_Fetch(&etype, &eval, &etb);
20346  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20347  __pyx_array___dealloc__(o);
20348  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20349  PyErr_Restore(etype, eval, etb);
20350  }
20351  Py_CLEAR(p->mode);
20352  Py_CLEAR(p->_format);
20353  (*Py_TYPE(o)->tp_free)(o);
20354 }
20355 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
20356  PyObject *r;
20357  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20358  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20359  Py_DECREF(x);
20360  return r;
20361 }
20362 
20363 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
20364  if (v) {
20365  return __pyx_array___setitem__(o, i, v);
20366  }
20367  else {
20368  PyErr_Format(PyExc_NotImplementedError,
20369  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20370  return -1;
20371  }
20372 }
20373 
20374 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
20375  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
20376  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
20377  PyErr_Clear();
20378  v = __pyx_array___getattr__(o, n);
20379  }
20380  return v;
20381 }
20382 
20383 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
20384  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
20385 }
20386 
20387 static PyMethodDef __pyx_methods_array[] = {
20388  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
20389  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
20390  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
20391  {0, 0, 0, 0}
20392 };
20393 
20394 static struct PyGetSetDef __pyx_getsets_array[] = {
20395  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
20396  {0, 0, 0, 0, 0}
20397 };
20398 
20399 static PySequenceMethods __pyx_tp_as_sequence_array = {
20400  __pyx_array___len__, /*sq_length*/
20401  0, /*sq_concat*/
20402  0, /*sq_repeat*/
20403  __pyx_sq_item_array, /*sq_item*/
20404  0, /*sq_slice*/
20405  0, /*sq_ass_item*/
20406  0, /*sq_ass_slice*/
20407  0, /*sq_contains*/
20408  0, /*sq_inplace_concat*/
20409  0, /*sq_inplace_repeat*/
20410 };
20411 
20412 static PyMappingMethods __pyx_tp_as_mapping_array = {
20413  __pyx_array___len__, /*mp_length*/
20414  __pyx_array___getitem__, /*mp_subscript*/
20415  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
20416 };
20417 
20418 static PyBufferProcs __pyx_tp_as_buffer_array = {
20419  #if PY_MAJOR_VERSION < 3
20420  0, /*bf_getreadbuffer*/
20421  #endif
20422  #if PY_MAJOR_VERSION < 3
20423  0, /*bf_getwritebuffer*/
20424  #endif
20425  #if PY_MAJOR_VERSION < 3
20426  0, /*bf_getsegcount*/
20427  #endif
20428  #if PY_MAJOR_VERSION < 3
20429  0, /*bf_getcharbuffer*/
20430  #endif
20431  __pyx_array_getbuffer, /*bf_getbuffer*/
20432  0, /*bf_releasebuffer*/
20433 };
20434 
20435 static PyTypeObject __pyx_type___pyx_array = {
20436  PyVarObject_HEAD_INIT(0, 0)
20437  "superluWrappers.array", /*tp_name*/
20438  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
20439  0, /*tp_itemsize*/
20440  __pyx_tp_dealloc_array, /*tp_dealloc*/
20441  #if PY_VERSION_HEX < 0x030800b4
20442  0, /*tp_print*/
20443  #endif
20444  #if PY_VERSION_HEX >= 0x030800b4
20445  0, /*tp_vectorcall_offset*/
20446  #endif
20447  0, /*tp_getattr*/
20448  0, /*tp_setattr*/
20449  #if PY_MAJOR_VERSION < 3
20450  0, /*tp_compare*/
20451  #endif
20452  #if PY_MAJOR_VERSION >= 3
20453  0, /*tp_as_async*/
20454  #endif
20455  0, /*tp_repr*/
20456  0, /*tp_as_number*/
20457  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
20458  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
20459  0, /*tp_hash*/
20460  0, /*tp_call*/
20461  0, /*tp_str*/
20462  __pyx_tp_getattro_array, /*tp_getattro*/
20463  0, /*tp_setattro*/
20464  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
20465  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
20466  0, /*tp_doc*/
20467  0, /*tp_traverse*/
20468  0, /*tp_clear*/
20469  0, /*tp_richcompare*/
20470  0, /*tp_weaklistoffset*/
20471  0, /*tp_iter*/
20472  0, /*tp_iternext*/
20473  __pyx_methods_array, /*tp_methods*/
20474  0, /*tp_members*/
20475  __pyx_getsets_array, /*tp_getset*/
20476  0, /*tp_base*/
20477  0, /*tp_dict*/
20478  0, /*tp_descr_get*/
20479  0, /*tp_descr_set*/
20480  0, /*tp_dictoffset*/
20481  0, /*tp_init*/
20482  0, /*tp_alloc*/
20483  __pyx_tp_new_array, /*tp_new*/
20484  0, /*tp_free*/
20485  0, /*tp_is_gc*/
20486  0, /*tp_bases*/
20487  0, /*tp_mro*/
20488  0, /*tp_cache*/
20489  0, /*tp_subclasses*/
20490  0, /*tp_weaklist*/
20491  0, /*tp_del*/
20492  0, /*tp_version_tag*/
20493  #if PY_VERSION_HEX >= 0x030400a1
20494  0, /*tp_finalize*/
20495  #endif
20496  #if PY_VERSION_HEX >= 0x030800b1
20497  0, /*tp_vectorcall*/
20498  #endif
20499  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20500  0, /*tp_print*/
20501  #endif
20502 };
20503 
20504 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20505  struct __pyx_MemviewEnum_obj *p;
20506  PyObject *o;
20507  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20508  o = (*t->tp_alloc)(t, 0);
20509  } else {
20510  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20511  }
20512  if (unlikely(!o)) return 0;
20513  p = ((struct __pyx_MemviewEnum_obj *)o);
20514  p->name = Py_None; Py_INCREF(Py_None);
20515  return o;
20516 }
20517 
20518 static void __pyx_tp_dealloc_Enum(PyObject *o) {
20519  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20520  #if CYTHON_USE_TP_FINALIZE
20521  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20522  if (PyObject_CallFinalizerFromDealloc(o)) return;
20523  }
20524  #endif
20525  PyObject_GC_UnTrack(o);
20526  Py_CLEAR(p->name);
20527  (*Py_TYPE(o)->tp_free)(o);
20528 }
20529 
20530 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
20531  int e;
20532  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20533  if (p->name) {
20534  e = (*v)(p->name, a); if (e) return e;
20535  }
20536  return 0;
20537 }
20538 
20539 static int __pyx_tp_clear_Enum(PyObject *o) {
20540  PyObject* tmp;
20541  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20542  tmp = ((PyObject*)p->name);
20543  p->name = Py_None; Py_INCREF(Py_None);
20544  Py_XDECREF(tmp);
20545  return 0;
20546 }
20547 
20548 static PyMethodDef __pyx_methods_Enum[] = {
20549  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
20550  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
20551  {0, 0, 0, 0}
20552 };
20553 
20554 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
20555  PyVarObject_HEAD_INIT(0, 0)
20556  "superluWrappers.Enum", /*tp_name*/
20557  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
20558  0, /*tp_itemsize*/
20559  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
20560  #if PY_VERSION_HEX < 0x030800b4
20561  0, /*tp_print*/
20562  #endif
20563  #if PY_VERSION_HEX >= 0x030800b4
20564  0, /*tp_vectorcall_offset*/
20565  #endif
20566  0, /*tp_getattr*/
20567  0, /*tp_setattr*/
20568  #if PY_MAJOR_VERSION < 3
20569  0, /*tp_compare*/
20570  #endif
20571  #if PY_MAJOR_VERSION >= 3
20572  0, /*tp_as_async*/
20573  #endif
20574  __pyx_MemviewEnum___repr__, /*tp_repr*/
20575  0, /*tp_as_number*/
20576  0, /*tp_as_sequence*/
20577  0, /*tp_as_mapping*/
20578  0, /*tp_hash*/
20579  0, /*tp_call*/
20580  0, /*tp_str*/
20581  0, /*tp_getattro*/
20582  0, /*tp_setattro*/
20583  0, /*tp_as_buffer*/
20584  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20585  0, /*tp_doc*/
20586  __pyx_tp_traverse_Enum, /*tp_traverse*/
20587  __pyx_tp_clear_Enum, /*tp_clear*/
20588  0, /*tp_richcompare*/
20589  0, /*tp_weaklistoffset*/
20590  0, /*tp_iter*/
20591  0, /*tp_iternext*/
20592  __pyx_methods_Enum, /*tp_methods*/
20593  0, /*tp_members*/
20594  0, /*tp_getset*/
20595  0, /*tp_base*/
20596  0, /*tp_dict*/
20597  0, /*tp_descr_get*/
20598  0, /*tp_descr_set*/
20599  0, /*tp_dictoffset*/
20600  __pyx_MemviewEnum___init__, /*tp_init*/
20601  0, /*tp_alloc*/
20602  __pyx_tp_new_Enum, /*tp_new*/
20603  0, /*tp_free*/
20604  0, /*tp_is_gc*/
20605  0, /*tp_bases*/
20606  0, /*tp_mro*/
20607  0, /*tp_cache*/
20608  0, /*tp_subclasses*/
20609  0, /*tp_weaklist*/
20610  0, /*tp_del*/
20611  0, /*tp_version_tag*/
20612  #if PY_VERSION_HEX >= 0x030400a1
20613  0, /*tp_finalize*/
20614  #endif
20615  #if PY_VERSION_HEX >= 0x030800b1
20616  0, /*tp_vectorcall*/
20617  #endif
20618  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20619  0, /*tp_print*/
20620  #endif
20621 };
20622 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
20623 
20624 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
20625  struct __pyx_memoryview_obj *p;
20626  PyObject *o;
20627  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20628  o = (*t->tp_alloc)(t, 0);
20629  } else {
20630  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20631  }
20632  if (unlikely(!o)) return 0;
20633  p = ((struct __pyx_memoryview_obj *)o);
20634  p->__pyx_vtab = __pyx_vtabptr_memoryview;
20635  p->obj = Py_None; Py_INCREF(Py_None);
20636  p->_size = Py_None; Py_INCREF(Py_None);
20637  p->_array_interface = Py_None; Py_INCREF(Py_None);
20638  p->view.obj = NULL;
20639  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
20640  return o;
20641  bad:
20642  Py_DECREF(o); o = 0;
20643  return NULL;
20644 }
20645 
20646 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
20647  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20648  #if CYTHON_USE_TP_FINALIZE
20649  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20650  if (PyObject_CallFinalizerFromDealloc(o)) return;
20651  }
20652  #endif
20653  PyObject_GC_UnTrack(o);
20654  {
20655  PyObject *etype, *eval, *etb;
20656  PyErr_Fetch(&etype, &eval, &etb);
20657  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20658  __pyx_memoryview___dealloc__(o);
20659  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20660  PyErr_Restore(etype, eval, etb);
20661  }
20662  Py_CLEAR(p->obj);
20663  Py_CLEAR(p->_size);
20664  Py_CLEAR(p->_array_interface);
20665  (*Py_TYPE(o)->tp_free)(o);
20666 }
20667 
20668 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
20669  int e;
20670  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20671  if (p->obj) {
20672  e = (*v)(p->obj, a); if (e) return e;
20673  }
20674  if (p->_size) {
20675  e = (*v)(p->_size, a); if (e) return e;
20676  }
20677  if (p->_array_interface) {
20678  e = (*v)(p->_array_interface, a); if (e) return e;
20679  }
20680  if (p->view.obj) {
20681  e = (*v)(p->view.obj, a); if (e) return e;
20682  }
20683  return 0;
20684 }
20685 
20686 static int __pyx_tp_clear_memoryview(PyObject *o) {
20687  PyObject* tmp;
20688  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20689  tmp = ((PyObject*)p->obj);
20690  p->obj = Py_None; Py_INCREF(Py_None);
20691  Py_XDECREF(tmp);
20692  tmp = ((PyObject*)p->_size);
20693  p->_size = Py_None; Py_INCREF(Py_None);
20694  Py_XDECREF(tmp);
20695  tmp = ((PyObject*)p->_array_interface);
20696  p->_array_interface = Py_None; Py_INCREF(Py_None);
20697  Py_XDECREF(tmp);
20698  Py_CLEAR(p->view.obj);
20699  return 0;
20700 }
20701 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
20702  PyObject *r;
20703  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20704  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20705  Py_DECREF(x);
20706  return r;
20707 }
20708 
20709 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
20710  if (v) {
20711  return __pyx_memoryview___setitem__(o, i, v);
20712  }
20713  else {
20714  PyErr_Format(PyExc_NotImplementedError,
20715  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20716  return -1;
20717  }
20718 }
20719 
20720 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
20721  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
20722 }
20723 
20724 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
20725  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
20726 }
20727 
20728 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
20729  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
20730 }
20731 
20732 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
20733  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
20734 }
20735 
20736 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
20737  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
20738 }
20739 
20740 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
20741  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
20742 }
20743 
20744 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
20745  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
20746 }
20747 
20748 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
20749  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
20750 }
20751 
20752 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
20753  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
20754 }
20755 
20756 static PyMethodDef __pyx_methods_memoryview[] = {
20757  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
20758  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
20759  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
20760  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
20761  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
20762  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
20763  {0, 0, 0, 0}
20764 };
20765 
20766 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
20767  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
20768  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
20769  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
20770  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
20771  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
20772  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
20773  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
20774  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
20775  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
20776  {0, 0, 0, 0, 0}
20777 };
20778 
20779 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
20780  __pyx_memoryview___len__, /*sq_length*/
20781  0, /*sq_concat*/
20782  0, /*sq_repeat*/
20783  __pyx_sq_item_memoryview, /*sq_item*/
20784  0, /*sq_slice*/
20785  0, /*sq_ass_item*/
20786  0, /*sq_ass_slice*/
20787  0, /*sq_contains*/
20788  0, /*sq_inplace_concat*/
20789  0, /*sq_inplace_repeat*/
20790 };
20791 
20792 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
20793  __pyx_memoryview___len__, /*mp_length*/
20794  __pyx_memoryview___getitem__, /*mp_subscript*/
20795  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
20796 };
20797 
20798 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
20799  #if PY_MAJOR_VERSION < 3
20800  0, /*bf_getreadbuffer*/
20801  #endif
20802  #if PY_MAJOR_VERSION < 3
20803  0, /*bf_getwritebuffer*/
20804  #endif
20805  #if PY_MAJOR_VERSION < 3
20806  0, /*bf_getsegcount*/
20807  #endif
20808  #if PY_MAJOR_VERSION < 3
20809  0, /*bf_getcharbuffer*/
20810  #endif
20811  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
20812  0, /*bf_releasebuffer*/
20813 };
20814 
20815 static PyTypeObject __pyx_type___pyx_memoryview = {
20816  PyVarObject_HEAD_INIT(0, 0)
20817  "superluWrappers.memoryview", /*tp_name*/
20818  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
20819  0, /*tp_itemsize*/
20820  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
20821  #if PY_VERSION_HEX < 0x030800b4
20822  0, /*tp_print*/
20823  #endif
20824  #if PY_VERSION_HEX >= 0x030800b4
20825  0, /*tp_vectorcall_offset*/
20826  #endif
20827  0, /*tp_getattr*/
20828  0, /*tp_setattr*/
20829  #if PY_MAJOR_VERSION < 3
20830  0, /*tp_compare*/
20831  #endif
20832  #if PY_MAJOR_VERSION >= 3
20833  0, /*tp_as_async*/
20834  #endif
20835  __pyx_memoryview___repr__, /*tp_repr*/
20836  0, /*tp_as_number*/
20837  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
20838  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
20839  0, /*tp_hash*/
20840  0, /*tp_call*/
20841  __pyx_memoryview___str__, /*tp_str*/
20842  0, /*tp_getattro*/
20843  0, /*tp_setattro*/
20844  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
20845  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20846  0, /*tp_doc*/
20847  __pyx_tp_traverse_memoryview, /*tp_traverse*/
20848  __pyx_tp_clear_memoryview, /*tp_clear*/
20849  0, /*tp_richcompare*/
20850  0, /*tp_weaklistoffset*/
20851  0, /*tp_iter*/
20852  0, /*tp_iternext*/
20853  __pyx_methods_memoryview, /*tp_methods*/
20854  0, /*tp_members*/
20855  __pyx_getsets_memoryview, /*tp_getset*/
20856  0, /*tp_base*/
20857  0, /*tp_dict*/
20858  0, /*tp_descr_get*/
20859  0, /*tp_descr_set*/
20860  0, /*tp_dictoffset*/
20861  0, /*tp_init*/
20862  0, /*tp_alloc*/
20863  __pyx_tp_new_memoryview, /*tp_new*/
20864  0, /*tp_free*/
20865  0, /*tp_is_gc*/
20866  0, /*tp_bases*/
20867  0, /*tp_mro*/
20868  0, /*tp_cache*/
20869  0, /*tp_subclasses*/
20870  0, /*tp_weaklist*/
20871  0, /*tp_del*/
20872  0, /*tp_version_tag*/
20873  #if PY_VERSION_HEX >= 0x030400a1
20874  0, /*tp_finalize*/
20875  #endif
20876  #if PY_VERSION_HEX >= 0x030800b1
20877  0, /*tp_vectorcall*/
20878  #endif
20879  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20880  0, /*tp_print*/
20881  #endif
20882 };
20883 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
20884 
20885 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
20886  struct __pyx_memoryviewslice_obj *p;
20887  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
20888  if (unlikely(!o)) return 0;
20889  p = ((struct __pyx_memoryviewslice_obj *)o);
20890  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
20891  p->from_object = Py_None; Py_INCREF(Py_None);
20892  p->from_slice.memview = NULL;
20893  return o;
20894 }
20895 
20896 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
20897  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20898  #if CYTHON_USE_TP_FINALIZE
20899  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20900  if (PyObject_CallFinalizerFromDealloc(o)) return;
20901  }
20902  #endif
20903  PyObject_GC_UnTrack(o);
20904  {
20905  PyObject *etype, *eval, *etb;
20906  PyErr_Fetch(&etype, &eval, &etb);
20907  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20908  __pyx_memoryviewslice___dealloc__(o);
20909  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20910  PyErr_Restore(etype, eval, etb);
20911  }
20912  Py_CLEAR(p->from_object);
20913  PyObject_GC_Track(o);
20914  __pyx_tp_dealloc_memoryview(o);
20915 }
20916 
20917 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
20918  int e;
20919  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20920  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
20921  if (p->from_object) {
20922  e = (*v)(p->from_object, a); if (e) return e;
20923  }
20924  return 0;
20925 }
20926 
20927 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
20928  PyObject* tmp;
20929  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20930  __pyx_tp_clear_memoryview(o);
20931  tmp = ((PyObject*)p->from_object);
20932  p->from_object = Py_None; Py_INCREF(Py_None);
20933  Py_XDECREF(tmp);
20934  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
20935  return 0;
20936 }
20937 
20938 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
20939  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
20940 }
20941 
20942 static PyMethodDef __pyx_methods__memoryviewslice[] = {
20943  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
20944  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
20945  {0, 0, 0, 0}
20946 };
20947 
20948 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
20949  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
20950  {0, 0, 0, 0, 0}
20951 };
20952 
20953 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
20954  PyVarObject_HEAD_INIT(0, 0)
20955  "superluWrappers._memoryviewslice", /*tp_name*/
20956  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
20957  0, /*tp_itemsize*/
20958  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
20959  #if PY_VERSION_HEX < 0x030800b4
20960  0, /*tp_print*/
20961  #endif
20962  #if PY_VERSION_HEX >= 0x030800b4
20963  0, /*tp_vectorcall_offset*/
20964  #endif
20965  0, /*tp_getattr*/
20966  0, /*tp_setattr*/
20967  #if PY_MAJOR_VERSION < 3
20968  0, /*tp_compare*/
20969  #endif
20970  #if PY_MAJOR_VERSION >= 3
20971  0, /*tp_as_async*/
20972  #endif
20973  #if CYTHON_COMPILING_IN_PYPY
20974  __pyx_memoryview___repr__, /*tp_repr*/
20975  #else
20976  0, /*tp_repr*/
20977  #endif
20978  0, /*tp_as_number*/
20979  0, /*tp_as_sequence*/
20980  0, /*tp_as_mapping*/
20981  0, /*tp_hash*/
20982  0, /*tp_call*/
20983  #if CYTHON_COMPILING_IN_PYPY
20984  __pyx_memoryview___str__, /*tp_str*/
20985  #else
20986  0, /*tp_str*/
20987  #endif
20988  0, /*tp_getattro*/
20989  0, /*tp_setattro*/
20990  0, /*tp_as_buffer*/
20991  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20992  "Internal class for passing memoryview slices to Python", /*tp_doc*/
20993  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
20994  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
20995  0, /*tp_richcompare*/
20996  0, /*tp_weaklistoffset*/
20997  0, /*tp_iter*/
20998  0, /*tp_iternext*/
20999  __pyx_methods__memoryviewslice, /*tp_methods*/
21000  0, /*tp_members*/
21001  __pyx_getsets__memoryviewslice, /*tp_getset*/
21002  0, /*tp_base*/
21003  0, /*tp_dict*/
21004  0, /*tp_descr_get*/
21005  0, /*tp_descr_set*/
21006  0, /*tp_dictoffset*/
21007  0, /*tp_init*/
21008  0, /*tp_alloc*/
21009  __pyx_tp_new__memoryviewslice, /*tp_new*/
21010  0, /*tp_free*/
21011  0, /*tp_is_gc*/
21012  0, /*tp_bases*/
21013  0, /*tp_mro*/
21014  0, /*tp_cache*/
21015  0, /*tp_subclasses*/
21016  0, /*tp_weaklist*/
21017  0, /*tp_del*/
21018  0, /*tp_version_tag*/
21019  #if PY_VERSION_HEX >= 0x030400a1
21020  0, /*tp_finalize*/
21021  #endif
21022  #if PY_VERSION_HEX >= 0x030800b1
21023  0, /*tp_vectorcall*/
21024  #endif
21025  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21026  0, /*tp_print*/
21027  #endif
21028 };
21029 
21030 static PyMethodDef __pyx_methods[] = {
21031  {0, 0, 0, 0}
21032 };
21033 
21034 #if PY_MAJOR_VERSION >= 3
21035 #if CYTHON_PEP489_MULTI_PHASE_INIT
21036 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
21037 static int __pyx_pymod_exec_superluWrappers(PyObject* module); /*proto*/
21038 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21039  {Py_mod_create, (void*)__pyx_pymod_create},
21040  {Py_mod_exec, (void*)__pyx_pymod_exec_superluWrappers},
21041  {0, NULL}
21042 };
21043 #endif
21044 
21045 static struct PyModuleDef __pyx_moduledef = {
21046  PyModuleDef_HEAD_INIT,
21047  "superluWrappers",
21048  0, /* m_doc */
21049  #if CYTHON_PEP489_MULTI_PHASE_INIT
21050  0, /* m_size */
21051  #else
21052  -1, /* m_size */
21053  #endif
21054  __pyx_methods /* m_methods */,
21055  #if CYTHON_PEP489_MULTI_PHASE_INIT
21056  __pyx_moduledef_slots, /* m_slots */
21057  #else
21058  NULL, /* m_reload */
21059  #endif
21060  NULL, /* m_traverse */
21061  NULL, /* m_clear */
21062  NULL /* m_free */
21063 };
21064 #endif
21065 #ifndef CYTHON_SMALL_CODE
21066 #if defined(__clang__)
21067  #define CYTHON_SMALL_CODE
21068 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
21069  #define CYTHON_SMALL_CODE __attribute__((cold))
21070 #else
21071  #define CYTHON_SMALL_CODE
21072 #endif
21073 #endif
21074 
21075 static __Pyx_StringTabEntry __pyx_string_tab[] = {
21076  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
21077  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
21078  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
21079  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
21080  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
21081  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
21082  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
21083  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
21084  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
21085  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
21086  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
21087  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
21088  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
21089  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
21090  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
21091  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
21092  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
21093  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
21094  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
21095  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
21096  {&__pyx_n_s_SparseFactor, __pyx_k_SparseFactor, sizeof(__pyx_k_SparseFactor), 0, 0, 1, 1},
21097  {&__pyx_n_s_SparseMatrix, __pyx_k_SparseMatrix, sizeof(__pyx_k_SparseMatrix), 0, 0, 1, 1},
21098  {&__pyx_n_s_SparseMatrix___init, __pyx_k_SparseMatrix___init, sizeof(__pyx_k_SparseMatrix___init), 0, 0, 1, 1},
21099  {&__pyx_n_s_SparseMatrix_fwrite, __pyx_k_SparseMatrix_fwrite, sizeof(__pyx_k_SparseMatrix_fwrite), 0, 0, 1, 1},
21100  {&__pyx_n_s_SparseMatrix_getCSRrepresentatio, __pyx_k_SparseMatrix_getCSRrepresentatio, sizeof(__pyx_k_SparseMatrix_getCSRrepresentatio), 0, 0, 1, 1},
21101  {&__pyx_n_s_SparseMatrix_getSubMatCSRreprese, __pyx_k_SparseMatrix_getSubMatCSRreprese, sizeof(__pyx_k_SparseMatrix_getSubMatCSRreprese), 0, 0, 1, 1},
21102  {&__pyx_n_s_SparseMatrix_matvec, __pyx_k_SparseMatrix_matvec, sizeof(__pyx_k_SparseMatrix_matvec), 0, 0, 1, 1},
21103  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
21104  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
21105  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
21106  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
21107  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
21108  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
21109  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
21110  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
21111  {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix, sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
21112  {&__pyx_n_s_cSparseMatrix_2, __pyx_k_cSparseMatrix_2, sizeof(__pyx_k_cSparseMatrix_2), 0, 0, 1, 1},
21113  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
21114  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
21115  {&__pyx_n_s_colind, __pyx_k_colind, sizeof(__pyx_k_colind), 0, 0, 1, 1},
21116  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
21117  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
21118  {&__pyx_kp_s_d_d_13_8e, __pyx_k_d_d_13_8e, sizeof(__pyx_k_d_d_13_8e), 0, 0, 1, 0},
21119  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
21120  {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1},
21121  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
21122  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
21123  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
21124  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
21125  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
21126  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
21127  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
21128  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
21129  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
21130  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
21131  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
21132  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
21133  {&__pyx_n_s_fwrite, __pyx_k_fwrite, sizeof(__pyx_k_fwrite), 0, 0, 1, 1},
21134  {&__pyx_n_s_getCSRrepresentation, __pyx_k_getCSRrepresentation, sizeof(__pyx_k_getCSRrepresentation), 0, 0, 1, 1},
21135  {&__pyx_n_s_getSubMatCSRrepresentation, __pyx_k_getSubMatCSRrepresentation, sizeof(__pyx_k_getSubMatCSRrepresentation), 0, 0, 1, 1},
21136  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
21137  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
21138  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
21139  {&__pyx_kp_s_i_i_i, __pyx_k_i_i_i, sizeof(__pyx_k_i_i_i), 0, 0, 1, 0},
21140  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
21141  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
21142  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
21143  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
21144  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
21145  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
21146  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
21147  {&__pyx_n_s_matvec, __pyx_k_matvec, sizeof(__pyx_k_matvec), 0, 0, 1, 1},
21148  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
21149  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
21150  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
21151  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
21152  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
21153  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
21154  {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
21155  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
21156  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
21157  {&__pyx_n_s_nnz, __pyx_k_nnz, sizeof(__pyx_k_nnz), 0, 0, 1, 1},
21158  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
21159  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
21160  {&__pyx_n_s_nr, __pyx_k_nr, sizeof(__pyx_k_nr), 0, 0, 1, 1},
21161  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
21162  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
21163  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
21164  {&__pyx_n_s_nzval, __pyx_k_nzval, sizeof(__pyx_k_nzval), 0, 0, 1, 1},
21165  {&__pyx_n_s_nzvals, __pyx_k_nzvals, sizeof(__pyx_k_nzvals), 0, 0, 1, 1},
21166  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
21167  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
21168  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
21169  {&__pyx_n_s_output_file, __pyx_k_output_file, sizeof(__pyx_k_output_file), 0, 0, 1, 1},
21170  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
21171  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
21172  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
21173  {&__pyx_kp_s_proteus_superluWrappers_pyx, __pyx_k_proteus_superluWrappers_pyx, sizeof(__pyx_k_proteus_superluWrappers_pyx), 0, 0, 1, 0},
21174  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
21175  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
21176  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
21177  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
21178  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
21179  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
21180  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
21181  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
21182  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
21183  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
21184  {&__pyx_n_s_range_end, __pyx_k_range_end, sizeof(__pyx_k_range_end), 0, 0, 1, 1},
21185  {&__pyx_n_s_range_start, __pyx_k_range_start, sizeof(__pyx_k_range_start), 0, 0, 1, 1},
21186  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
21187  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
21188  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
21189  {&__pyx_n_s_rowptr, __pyx_k_rowptr, sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
21190  {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1},
21191  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
21192  {&__pyx_kp_s_self_A_self_AC_self_L_self_U_sel, __pyx_k_self_A_self_AC_self_L_self_U_sel, sizeof(__pyx_k_self_A_self_AC_self_L_self_U_sel), 0, 0, 1, 0},
21193  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
21194  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
21195  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
21196  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
21197  {&__pyx_n_s_sparseFactor, __pyx_k_sparseFactor, sizeof(__pyx_k_sparseFactor), 0, 0, 1, 1},
21198  {&__pyx_n_s_sparseFactorPrepare, __pyx_k_sparseFactorPrepare, sizeof(__pyx_k_sparseFactorPrepare), 0, 0, 1, 1},
21199  {&__pyx_n_s_sparseFactorSolve, __pyx_k_sparseFactorSolve, sizeof(__pyx_k_sparseFactorSolve), 0, 0, 1, 1},
21200  {&__pyx_n_s_sparse_matrix, __pyx_k_sparse_matrix, sizeof(__pyx_k_sparse_matrix), 0, 0, 1, 1},
21201  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
21202  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
21203  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
21204  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
21205  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
21206  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
21207  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
21208  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
21209  {&__pyx_n_s_superluWrappers, __pyx_k_superluWrappers, sizeof(__pyx_k_superluWrappers), 0, 0, 1, 1},
21210  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
21211  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
21212  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
21213  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
21214  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
21215  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
21216  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
21217  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
21218  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
21219  {0, 0, 0, 0, 0, 0, 0}
21220 };
21221 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
21222  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 13, __pyx_L1_error)
21223  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 56, __pyx_L1_error)
21224  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 58, __pyx_L1_error)
21225  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
21226  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
21227  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
21228  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
21229  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
21230  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
21231  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
21232  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
21233  return 0;
21234  __pyx_L1_error:;
21235  return -1;
21236 }
21237 
21238 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
21239  __Pyx_RefNannyDeclarations
21240  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
21241 
21242  /* "superluWrappers.pyx":56
21243  * ?!Possibly something to do with parallel?!
21244  * """
21245  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
21246  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
21247  * for i in range(self.nr):
21248  */
21249  __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 56, __pyx_L1_error)
21250  __Pyx_GOTREF(__pyx_tuple_);
21251  __Pyx_GIVEREF(__pyx_tuple_);
21252 
21253  /* "(tree fragment)":2
21254  * def __reduce_cython__(self):
21255  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21256  * def __setstate_cython__(self, __pyx_state):
21257  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21258  */
21259  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 2, __pyx_L1_error)
21260  __Pyx_GOTREF(__pyx_tuple__2);
21261  __Pyx_GIVEREF(__pyx_tuple__2);
21262 
21263  /* "(tree fragment)":4
21264  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21265  * def __setstate_cython__(self, __pyx_state):
21266  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21267  */
21268  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error)
21269  __Pyx_GOTREF(__pyx_tuple__3);
21270  __Pyx_GIVEREF(__pyx_tuple__3);
21271 
21272  /* "(tree fragment)":2
21273  * def __reduce_cython__(self):
21274  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
21275  * def __setstate_cython__(self, __pyx_state):
21276  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
21277  */
21278  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
21279  __Pyx_GOTREF(__pyx_tuple__4);
21280  __Pyx_GIVEREF(__pyx_tuple__4);
21281 
21282  /* "(tree fragment)":4
21283  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
21284  * def __setstate_cython__(self, __pyx_state):
21285  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
21286  */
21287  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
21288  __Pyx_GOTREF(__pyx_tuple__5);
21289  __Pyx_GIVEREF(__pyx_tuple__5);
21290 
21291  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945
21292  * __pyx_import_array()
21293  * except Exception:
21294  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
21295  *
21296  * cdef inline int import_umath() except -1:
21297  */
21298  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 945, __pyx_L1_error)
21299  __Pyx_GOTREF(__pyx_tuple__6);
21300  __Pyx_GIVEREF(__pyx_tuple__6);
21301 
21302  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951
21303  * _import_umath()
21304  * except Exception:
21305  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
21306  *
21307  * cdef inline int import_ufunc() except -1:
21308  */
21309  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 951, __pyx_L1_error)
21310  __Pyx_GOTREF(__pyx_tuple__7);
21311  __Pyx_GIVEREF(__pyx_tuple__7);
21312 
21313  /* "View.MemoryView":133
21314  *
21315  * if not self.ndim:
21316  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
21317  *
21318  * if itemsize <= 0:
21319  */
21320  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 133, __pyx_L1_error)
21321  __Pyx_GOTREF(__pyx_tuple__8);
21322  __Pyx_GIVEREF(__pyx_tuple__8);
21323 
21324  /* "View.MemoryView":136
21325  *
21326  * if itemsize <= 0:
21327  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
21328  *
21329  * if not isinstance(format, bytes):
21330  */
21331  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 136, __pyx_L1_error)
21332  __Pyx_GOTREF(__pyx_tuple__9);
21333  __Pyx_GIVEREF(__pyx_tuple__9);
21334 
21335  /* "View.MemoryView":148
21336  *
21337  * if not self._shape:
21338  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
21339  *
21340  *
21341  */
21342  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 148, __pyx_L1_error)
21343  __Pyx_GOTREF(__pyx_tuple__10);
21344  __Pyx_GIVEREF(__pyx_tuple__10);
21345 
21346  /* "View.MemoryView":176
21347  * self.data = <char *>malloc(self.len)
21348  * if not self.data:
21349  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
21350  *
21351  * if self.dtype_is_object:
21352  */
21353  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 176, __pyx_L1_error)
21354  __Pyx_GOTREF(__pyx_tuple__11);
21355  __Pyx_GIVEREF(__pyx_tuple__11);
21356 
21357  /* "View.MemoryView":192
21358  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21359  * if not (flags & bufmode):
21360  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
21361  * info.buf = self.data
21362  * info.len = self.len
21363  */
21364  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 192, __pyx_L1_error)
21365  __Pyx_GOTREF(__pyx_tuple__12);
21366  __Pyx_GIVEREF(__pyx_tuple__12);
21367 
21368  /* "(tree fragment)":2
21369  * def __reduce_cython__(self):
21370  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21371  * def __setstate_cython__(self, __pyx_state):
21372  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21373  */
21374  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 2, __pyx_L1_error)
21375  __Pyx_GOTREF(__pyx_tuple__13);
21376  __Pyx_GIVEREF(__pyx_tuple__13);
21377 
21378  /* "(tree fragment)":4
21379  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21380  * def __setstate_cython__(self, __pyx_state):
21381  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21382  */
21383  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error)
21384  __Pyx_GOTREF(__pyx_tuple__14);
21385  __Pyx_GIVEREF(__pyx_tuple__14);
21386 
21387  /* "View.MemoryView":418
21388  * def __setitem__(memoryview self, object index, object value):
21389  * if self.view.readonly:
21390  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
21391  *
21392  * have_slices, index = _unellipsify(index, self.view.ndim)
21393  */
21394  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 418, __pyx_L1_error)
21395  __Pyx_GOTREF(__pyx_tuple__15);
21396  __Pyx_GIVEREF(__pyx_tuple__15);
21397 
21398  /* "View.MemoryView":495
21399  * result = struct.unpack(self.view.format, bytesitem)
21400  * except struct.error:
21401  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
21402  * else:
21403  * if len(self.view.format) == 1:
21404  */
21405  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 495, __pyx_L1_error)
21406  __Pyx_GOTREF(__pyx_tuple__16);
21407  __Pyx_GIVEREF(__pyx_tuple__16);
21408 
21409  /* "View.MemoryView":520
21410  * def __getbuffer__(self, Py_buffer *info, int flags):
21411  * if flags & PyBUF_WRITABLE and self.view.readonly:
21412  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
21413  *
21414  * if flags & PyBUF_ND:
21415  */
21416  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 520, __pyx_L1_error)
21417  __Pyx_GOTREF(__pyx_tuple__17);
21418  __Pyx_GIVEREF(__pyx_tuple__17);
21419 
21420  /* "View.MemoryView":570
21421  * if self.view.strides == NULL:
21422  *
21423  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
21424  *
21425  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
21426  */
21427  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 570, __pyx_L1_error)
21428  __Pyx_GOTREF(__pyx_tuple__18);
21429  __Pyx_GIVEREF(__pyx_tuple__18);
21430 
21431  /* "View.MemoryView":577
21432  * def suboffsets(self):
21433  * if self.view.suboffsets == NULL:
21434  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
21435  *
21436  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
21437  */
21438  __pyx_tuple__19 = PyTuple_New(1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 577, __pyx_L1_error)
21439  __Pyx_GOTREF(__pyx_tuple__19);
21440  __Pyx_INCREF(__pyx_int_neg_1);
21441  __Pyx_GIVEREF(__pyx_int_neg_1);
21442  PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1);
21443  __Pyx_GIVEREF(__pyx_tuple__19);
21444 
21445  /* "(tree fragment)":2
21446  * def __reduce_cython__(self):
21447  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21448  * def __setstate_cython__(self, __pyx_state):
21449  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21450  */
21451  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error)
21452  __Pyx_GOTREF(__pyx_tuple__20);
21453  __Pyx_GIVEREF(__pyx_tuple__20);
21454 
21455  /* "(tree fragment)":4
21456  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21457  * def __setstate_cython__(self, __pyx_state):
21458  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21459  */
21460  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
21461  __Pyx_GOTREF(__pyx_tuple__21);
21462  __Pyx_GIVEREF(__pyx_tuple__21);
21463 
21464  /* "View.MemoryView":682
21465  * if item is Ellipsis:
21466  * if not seen_ellipsis:
21467  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
21468  * seen_ellipsis = True
21469  * else:
21470  */
21471  __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(1, 682, __pyx_L1_error)
21472  __Pyx_GOTREF(__pyx_slice__22);
21473  __Pyx_GIVEREF(__pyx_slice__22);
21474 
21475  /* "View.MemoryView":703
21476  * for suboffset in suboffsets[:ndim]:
21477  * if suboffset >= 0:
21478  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
21479  *
21480  *
21481  */
21482  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 703, __pyx_L1_error)
21483  __Pyx_GOTREF(__pyx_tuple__23);
21484  __Pyx_GIVEREF(__pyx_tuple__23);
21485 
21486  /* "(tree fragment)":2
21487  * def __reduce_cython__(self):
21488  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21489  * def __setstate_cython__(self, __pyx_state):
21490  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21491  */
21492  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 2, __pyx_L1_error)
21493  __Pyx_GOTREF(__pyx_tuple__24);
21494  __Pyx_GIVEREF(__pyx_tuple__24);
21495 
21496  /* "(tree fragment)":4
21497  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21498  * def __setstate_cython__(self, __pyx_state):
21499  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21500  */
21501  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error)
21502  __Pyx_GOTREF(__pyx_tuple__25);
21503  __Pyx_GIVEREF(__pyx_tuple__25);
21504 
21505  /* "superluWrappers.pyx":13
21506  * from libc.stdlib cimport malloc
21507  *
21508  * class SparseMatrix(object): # <<<<<<<<<<<<<<
21509  *
21510  * def __init__(self,
21511  */
21512  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 13, __pyx_L1_error)
21513  __Pyx_GOTREF(__pyx_tuple__26);
21514  __Pyx_GIVEREF(__pyx_tuple__26);
21515 
21516  /* "superluWrappers.pyx":15
21517  * class SparseMatrix(object):
21518  *
21519  * def __init__(self, # <<<<<<<<<<<<<<
21520  * nr,
21521  * nc,
21522  */
21523  __pyx_tuple__27 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_nr, __pyx_n_s_nc, __pyx_n_s_nnz, __pyx_n_s_nzvals, __pyx_n_s_colind, __pyx_n_s_rowptr); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 15, __pyx_L1_error)
21524  __Pyx_GOTREF(__pyx_tuple__27);
21525  __Pyx_GIVEREF(__pyx_tuple__27);
21526  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_init, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 15, __pyx_L1_error)
21527 
21528  /* "superluWrappers.pyx":35
21529  * self.rowptr)
21530  *
21531  * def matvec(self, x, y): # <<<<<<<<<<<<<<
21532  * """
21533  * Compute the sparse matrix-vector product y = Ax
21534  */
21535  __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 35, __pyx_L1_error)
21536  __Pyx_GOTREF(__pyx_tuple__29);
21537  __Pyx_GIVEREF(__pyx_tuple__29);
21538  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_matvec, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 35, __pyx_L1_error)
21539 
21540  /* "superluWrappers.pyx":46
21541  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
21542  *
21543  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
21544  * """ Write the sparse matrix to a file
21545  *
21546  */
21547  __pyx_tuple__31 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_base, __pyx_n_s_output_file, __pyx_n_s_i, __pyx_n_s_k); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 46, __pyx_L1_error)
21548  __Pyx_GOTREF(__pyx_tuple__31);
21549  __Pyx_GIVEREF(__pyx_tuple__31);
21550  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_fwrite, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 46, __pyx_L1_error)
21551 
21552  /* "superluWrappers.pyx":62
21553  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
21554  *
21555  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
21556  * """ Get the CSR representation of the sparse matrix.
21557  *
21558  */
21559  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 62, __pyx_L1_error)
21560  __Pyx_GOTREF(__pyx_tuple__33);
21561  __Pyx_GIVEREF(__pyx_tuple__33);
21562  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getCSRrepresentation, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 62, __pyx_L1_error)
21563 
21564  /* "superluWrappers.pyx":72
21565  * return (self.rowptr, self.colind, self.nzvals)
21566  *
21567  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
21568  * range_start,
21569  * range_end):
21570  */
21571  __pyx_tuple__35 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_range_start, __pyx_n_s_range_end, __pyx_n_s_rows, __pyx_n_s_nnz, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nzvals); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 72, __pyx_L1_error)
21572  __Pyx_GOTREF(__pyx_tuple__35);
21573  __Pyx_GIVEREF(__pyx_tuple__35);
21574  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getSubMatCSRrepresentation, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 72, __pyx_L1_error)
21575 
21576  /* "superluWrappers.pyx":219
21577  * self.X.Store = &self.storeX
21578  *
21579  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
21580  * sparseFactor):
21581  * """ Python wrapper for superlu Sparse Factor Prepare function.
21582  */
21583  __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_sparse_matrix, __pyx_n_s_sparseFactor); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 219, __pyx_L1_error)
21584  __Pyx_GOTREF(__pyx_tuple__37);
21585  __Pyx_GIVEREF(__pyx_tuple__37);
21586  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorPrepare, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 219, __pyx_L1_error)
21587 
21588  /* "superluWrappers.pyx":286
21589  * &info)
21590  *
21591  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
21592  * x):
21593  * """ Sparse factor solve wrappers
21594  */
21595  __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_sparseFactor, __pyx_n_s_x); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 286, __pyx_L1_error)
21596  __Pyx_GOTREF(__pyx_tuple__39);
21597  __Pyx_GIVEREF(__pyx_tuple__39);
21598  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorSolve, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 286, __pyx_L1_error)
21599 
21600  /* "View.MemoryView":286
21601  * return self.name
21602  *
21603  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
21604  * cdef strided = Enum("<strided and direct>") # default
21605  * cdef indirect = Enum("<strided and indirect>")
21606  */
21607  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 286, __pyx_L1_error)
21608  __Pyx_GOTREF(__pyx_tuple__41);
21609  __Pyx_GIVEREF(__pyx_tuple__41);
21610 
21611  /* "View.MemoryView":287
21612  *
21613  * cdef generic = Enum("<strided and direct or indirect>")
21614  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
21615  * cdef indirect = Enum("<strided and indirect>")
21616  *
21617  */
21618  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 287, __pyx_L1_error)
21619  __Pyx_GOTREF(__pyx_tuple__42);
21620  __Pyx_GIVEREF(__pyx_tuple__42);
21621 
21622  /* "View.MemoryView":288
21623  * cdef generic = Enum("<strided and direct or indirect>")
21624  * cdef strided = Enum("<strided and direct>") # default
21625  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
21626  *
21627  *
21628  */
21629  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 288, __pyx_L1_error)
21630  __Pyx_GOTREF(__pyx_tuple__43);
21631  __Pyx_GIVEREF(__pyx_tuple__43);
21632 
21633  /* "View.MemoryView":291
21634  *
21635  *
21636  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
21637  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
21638  *
21639  */
21640  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 291, __pyx_L1_error)
21641  __Pyx_GOTREF(__pyx_tuple__44);
21642  __Pyx_GIVEREF(__pyx_tuple__44);
21643 
21644  /* "View.MemoryView":292
21645  *
21646  * cdef contiguous = Enum("<contiguous and direct>")
21647  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
21648  *
21649  *
21650  */
21651  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 292, __pyx_L1_error)
21652  __Pyx_GOTREF(__pyx_tuple__45);
21653  __Pyx_GIVEREF(__pyx_tuple__45);
21654 
21655  /* "(tree fragment)":1
21656  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21657  * cdef object __pyx_PickleError
21658  * cdef object __pyx_result
21659  */
21660  __pyx_tuple__46 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 1, __pyx_L1_error)
21661  __Pyx_GOTREF(__pyx_tuple__46);
21662  __Pyx_GIVEREF(__pyx_tuple__46);
21663  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(1, 1, __pyx_L1_error)
21664  __Pyx_RefNannyFinishContext();
21665  return 0;
21666  __pyx_L1_error:;
21667  __Pyx_RefNannyFinishContext();
21668  return -1;
21669 }
21670 
21671 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
21672  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
21673  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
21674  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21675  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
21676  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21677  return 0;
21678  __pyx_L1_error:;
21679  return -1;
21680 }
21681 
21682 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
21683 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
21684 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
21685 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
21686 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
21687 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
21688 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
21689 
21690 static int __Pyx_modinit_global_init_code(void) {
21691  __Pyx_RefNannyDeclarations
21692  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
21693  /*--- Global init code ---*/
21694  generic = Py_None; Py_INCREF(Py_None);
21695  strided = Py_None; Py_INCREF(Py_None);
21696  indirect = Py_None; Py_INCREF(Py_None);
21697  contiguous = Py_None; Py_INCREF(Py_None);
21698  indirect_contiguous = Py_None; Py_INCREF(Py_None);
21699  __Pyx_RefNannyFinishContext();
21700  return 0;
21701 }
21702 
21703 static int __Pyx_modinit_variable_export_code(void) {
21704  __Pyx_RefNannyDeclarations
21705  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
21706  /*--- Variable export code ---*/
21707  __Pyx_RefNannyFinishContext();
21708  return 0;
21709 }
21710 
21711 static int __Pyx_modinit_function_export_code(void) {
21712  __Pyx_RefNannyDeclarations
21713  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
21714  /*--- Function export code ---*/
21715  __Pyx_RefNannyFinishContext();
21716  return 0;
21717 }
21718 
21719 static int __Pyx_modinit_type_init_code(void) {
21720  __Pyx_RefNannyDeclarations
21721  int __pyx_lineno = 0;
21722  const char *__pyx_filename = NULL;
21723  int __pyx_clineno = 0;
21724  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
21725  /*--- Type init code ---*/
21726  if (PyType_Ready(&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
21727  #if PY_VERSION_HEX < 0x030800B1
21728  __pyx_type_15superluWrappers_cSparseMatrix.tp_print = 0;
21729  #endif
21730  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_cSparseMatrix.tp_dictoffset && __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro == PyObject_GenericGetAttr)) {
21731  __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21732  }
21733  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cSparseMatrix_2, (PyObject *)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
21734  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
21735  __pyx_ptype_15superluWrappers_cSparseMatrix = &__pyx_type_15superluWrappers_cSparseMatrix;
21736  __pyx_vtabptr_15superluWrappers_SparseFactor = &__pyx_vtable_15superluWrappers_SparseFactor;
21737  __pyx_vtable_15superluWrappers_SparseFactor._set_mat_types = (PyObject *(*)(struct __pyx_obj_15superluWrappers_SparseFactor *))__pyx_f_15superluWrappers_12SparseFactor__set_mat_types;
21738  if (PyType_Ready(&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
21739  #if PY_VERSION_HEX < 0x030800B1
21740  __pyx_type_15superluWrappers_SparseFactor.tp_print = 0;
21741  #endif
21742  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_SparseFactor.tp_dictoffset && __pyx_type_15superluWrappers_SparseFactor.tp_getattro == PyObject_GenericGetAttr)) {
21743  __pyx_type_15superluWrappers_SparseFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21744  }
21745  #if CYTHON_COMPILING_IN_CPYTHON
21746  {
21747  PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_15superluWrappers_SparseFactor, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 145, __pyx_L1_error)
21748  if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21749  __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21750  __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__.doc = __pyx_doc_15superluWrappers_12SparseFactor___init__;
21751  ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
21752  }
21753  }
21754  #endif
21755  if (__Pyx_SetVtable(__pyx_type_15superluWrappers_SparseFactor.tp_dict, __pyx_vtabptr_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
21756  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SparseFactor, (PyObject *)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
21757  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
21758  __pyx_ptype_15superluWrappers_SparseFactor = &__pyx_type_15superluWrappers_SparseFactor;
21759  __pyx_vtabptr_array = &__pyx_vtable_array;
21760  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
21761  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
21762  #if PY_VERSION_HEX < 0x030800B1
21763  __pyx_type___pyx_array.tp_print = 0;
21764  #endif
21765  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
21766  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
21767  __pyx_array_type = &__pyx_type___pyx_array;
21768  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
21769  #if PY_VERSION_HEX < 0x030800B1
21770  __pyx_type___pyx_MemviewEnum.tp_print = 0;
21771  #endif
21772  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
21773  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21774  }
21775  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
21776  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
21777  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
21778  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
21779  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
21780  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
21781  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
21782  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
21783  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
21784  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
21785  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
21786  #if PY_VERSION_HEX < 0x030800B1
21787  __pyx_type___pyx_memoryview.tp_print = 0;
21788  #endif
21789  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
21790  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21791  }
21792  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
21793  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
21794  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
21795  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
21796  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
21797  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
21798  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
21799  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
21800  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
21801  #if PY_VERSION_HEX < 0x030800B1
21802  __pyx_type___pyx_memoryviewslice.tp_print = 0;
21803  #endif
21804  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
21805  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21806  }
21807  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
21808  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
21809  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
21810  __Pyx_RefNannyFinishContext();
21811  return 0;
21812  __pyx_L1_error:;
21813  __Pyx_RefNannyFinishContext();
21814  return -1;
21815 }
21816 
21817 static int __Pyx_modinit_type_import_code(void) {
21818  __Pyx_RefNannyDeclarations
21819  PyObject *__pyx_t_1 = NULL;
21820  int __pyx_lineno = 0;
21821  const char *__pyx_filename = NULL;
21822  int __pyx_clineno = 0;
21823  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
21824  /*--- Type import code ---*/
21825  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
21826  __Pyx_GOTREF(__pyx_t_1);
21827  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
21828  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
21829  sizeof(PyTypeObject),
21830  #else
21831  sizeof(PyHeapTypeObject),
21832  #endif
21833  __Pyx_ImportType_CheckSize_Warn);
21834  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
21835  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21836  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
21837  __Pyx_GOTREF(__pyx_t_1);
21838  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
21839  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
21840  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
21841  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
21842  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
21843  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
21844  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
21845  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
21846  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21847  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
21848  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21849  if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
21850  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21851  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
21852  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21853  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
21854  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21855  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
21856  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21857  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
21858  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21859  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
21860  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21861  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
21862  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21863  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
21864  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21865  if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
21866  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
21867  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
21868  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21869  __Pyx_RefNannyFinishContext();
21870  return 0;
21871  __pyx_L1_error:;
21872  __Pyx_XDECREF(__pyx_t_1);
21873  __Pyx_RefNannyFinishContext();
21874  return -1;
21875 }
21876 
21877 static int __Pyx_modinit_variable_import_code(void) {
21878  __Pyx_RefNannyDeclarations
21879  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
21880  /*--- Variable import code ---*/
21881  __Pyx_RefNannyFinishContext();
21882  return 0;
21883 }
21884 
21885 static int __Pyx_modinit_function_import_code(void) {
21886  __Pyx_RefNannyDeclarations
21887  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
21888  /*--- Function import code ---*/
21889  __Pyx_RefNannyFinishContext();
21890  return 0;
21891 }
21892 
21893 
21894 #ifndef CYTHON_NO_PYINIT_EXPORT
21895 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
21896 #elif PY_MAJOR_VERSION < 3
21897 #ifdef __cplusplus
21898 #define __Pyx_PyMODINIT_FUNC extern "C" void
21899 #else
21900 #define __Pyx_PyMODINIT_FUNC void
21901 #endif
21902 #else
21903 #ifdef __cplusplus
21904 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
21905 #else
21906 #define __Pyx_PyMODINIT_FUNC PyObject *
21907 #endif
21908 #endif
21909 
21910 
21911 #if PY_MAJOR_VERSION < 3
21912 __Pyx_PyMODINIT_FUNC initsuperluWrappers(void) CYTHON_SMALL_CODE; /*proto*/
21913 __Pyx_PyMODINIT_FUNC initsuperluWrappers(void)
21914 #else
21915 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void) CYTHON_SMALL_CODE; /*proto*/
21916 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)
21917 #if CYTHON_PEP489_MULTI_PHASE_INIT
21918 {
21919  return PyModuleDef_Init(&__pyx_moduledef);
21920 }
21921 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
21922  #if PY_VERSION_HEX >= 0x030700A1
21923  static PY_INT64_T main_interpreter_id = -1;
21924  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
21925  if (main_interpreter_id == -1) {
21926  main_interpreter_id = current_id;
21927  return (unlikely(current_id == -1)) ? -1 : 0;
21928  } else if (unlikely(main_interpreter_id != current_id))
21929  #else
21930  static PyInterpreterState *main_interpreter = NULL;
21931  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
21932  if (!main_interpreter) {
21933  main_interpreter = current_interpreter;
21934  } else if (unlikely(main_interpreter != current_interpreter))
21935  #endif
21936  {
21937  PyErr_SetString(
21938  PyExc_ImportError,
21939  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
21940  return -1;
21941  }
21942  return 0;
21943 }
21944 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
21945  PyObject *value = PyObject_GetAttrString(spec, from_name);
21946  int result = 0;
21947  if (likely(value)) {
21948  if (allow_none || value != Py_None) {
21949  result = PyDict_SetItemString(moddict, to_name, value);
21950  }
21951  Py_DECREF(value);
21952  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
21953  PyErr_Clear();
21954  } else {
21955  result = -1;
21956  }
21957  return result;
21958 }
21959 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
21960  PyObject *module = NULL, *moddict, *modname;
21961  if (__Pyx_check_single_interpreter())
21962  return NULL;
21963  if (__pyx_m)
21964  return __Pyx_NewRef(__pyx_m);
21965  modname = PyObject_GetAttrString(spec, "name");
21966  if (unlikely(!modname)) goto bad;
21967  module = PyModule_NewObject(modname);
21968  Py_DECREF(modname);
21969  if (unlikely(!module)) goto bad;
21970  moddict = PyModule_GetDict(module);
21971  if (unlikely(!moddict)) goto bad;
21972  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
21973  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
21974  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
21975  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
21976  return module;
21977 bad:
21978  Py_XDECREF(module);
21979  return NULL;
21980 }
21981 
21982 
21983 static CYTHON_SMALL_CODE int __pyx_pymod_exec_superluWrappers(PyObject *__pyx_pyinit_module)
21984 #endif
21985 #endif
21986 {
21987  PyObject *__pyx_t_1 = NULL;
21988  PyObject *__pyx_t_2 = NULL;
21989  PyObject *__pyx_t_3 = NULL;
21990  static PyThread_type_lock __pyx_t_4[8];
21991  int __pyx_lineno = 0;
21992  const char *__pyx_filename = NULL;
21993  int __pyx_clineno = 0;
21994  __Pyx_RefNannyDeclarations
21995  #if CYTHON_PEP489_MULTI_PHASE_INIT
21996  if (__pyx_m) {
21997  if (__pyx_m == __pyx_pyinit_module) return 0;
21998  PyErr_SetString(PyExc_RuntimeError, "Module 'superluWrappers' has already been imported. Re-initialisation is not supported.");
21999  return -1;
22000  }
22001  #elif PY_MAJOR_VERSION >= 3
22002  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
22003  #endif
22004  #if CYTHON_REFNANNY
22005 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
22006 if (!__Pyx_RefNanny) {
22007  PyErr_Clear();
22008  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
22009  if (!__Pyx_RefNanny)
22010  Py_FatalError("failed to import 'refnanny' module");
22011 }
22012 #endif
22013  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)", 0);
22014  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22015  #ifdef __Pxy_PyFrame_Initialize_Offsets
22016  __Pxy_PyFrame_Initialize_Offsets();
22017  #endif
22018  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22019  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22020  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22021  #ifdef __Pyx_CyFunction_USED
22022  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22023  #endif
22024  #ifdef __Pyx_FusedFunction_USED
22025  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22026  #endif
22027  #ifdef __Pyx_Coroutine_USED
22028  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22029  #endif
22030  #ifdef __Pyx_Generator_USED
22031  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22032  #endif
22033  #ifdef __Pyx_AsyncGen_USED
22034  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22035  #endif
22036  #ifdef __Pyx_StopAsyncIteration_USED
22037  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22038  #endif
22039  /*--- Library function declarations ---*/
22040  /*--- Threads initialization code ---*/
22041  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22042  PyEval_InitThreads();
22043  #endif
22044  /*--- Module creation code ---*/
22045  #if CYTHON_PEP489_MULTI_PHASE_INIT
22046  __pyx_m = __pyx_pyinit_module;
22047  Py_INCREF(__pyx_m);
22048  #else
22049  #if PY_MAJOR_VERSION < 3
22050  __pyx_m = Py_InitModule4("superluWrappers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22051  #else
22052  __pyx_m = PyModule_Create(&__pyx_moduledef);
22053  #endif
22054  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
22055  #endif
22056  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
22057  Py_INCREF(__pyx_d);
22058  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
22059  Py_INCREF(__pyx_b);
22060  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
22061  Py_INCREF(__pyx_cython_runtime);
22062  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22063  /*--- Initialize various global constants etc. ---*/
22064  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22065  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
22066  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22067  #endif
22068  if (__pyx_module_is_main_superluWrappers) {
22069  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22070  }
22071  #if PY_MAJOR_VERSION >= 3
22072  {
22073  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
22074  if (!PyDict_GetItemString(modules, "superluWrappers")) {
22075  if (unlikely(PyDict_SetItemString(modules, "superluWrappers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22076  }
22077  }
22078  #endif
22079  /*--- Builtin init code ---*/
22080  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22081  /*--- Constants init code ---*/
22082  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22083  /*--- Global type/function init code ---*/
22084  (void)__Pyx_modinit_global_init_code();
22085  (void)__Pyx_modinit_variable_export_code();
22086  (void)__Pyx_modinit_function_export_code();
22087  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22088  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22089  (void)__Pyx_modinit_variable_import_code();
22090  (void)__Pyx_modinit_function_import_code();
22091  /*--- Execution code ---*/
22092  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22093  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22094  #endif
22095 
22096  /* "superluWrappers.pyx":7
22097  * # correctly. perhaps they should only be enabled when not in debug mode?
22098  *
22099  * import numpy as np # <<<<<<<<<<<<<<
22100  * import cython
22101  * cimport numpy as np
22102  */
22103  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
22104  __Pyx_GOTREF(__pyx_t_1);
22105  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
22106  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22107 
22108  /* "superluWrappers.pyx":13
22109  * from libc.stdlib cimport malloc
22110  *
22111  * class SparseMatrix(object): # <<<<<<<<<<<<<<
22112  *
22113  * def __init__(self,
22114  */
22115  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__26); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
22116  __Pyx_GOTREF(__pyx_t_1);
22117  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__26, __pyx_n_s_SparseMatrix, __pyx_n_s_SparseMatrix, (PyObject *) NULL, __pyx_n_s_superluWrappers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
22118  __Pyx_GOTREF(__pyx_t_2);
22119 
22120  /* "superluWrappers.pyx":15
22121  * class SparseMatrix(object):
22122  *
22123  * def __init__(self, # <<<<<<<<<<<<<<
22124  * nr,
22125  * nc,
22126  */
22127  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_1__init__, 0, __pyx_n_s_SparseMatrix___init, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
22128  __Pyx_GOTREF(__pyx_t_3);
22129  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
22130  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22131 
22132  /* "superluWrappers.pyx":35
22133  * self.rowptr)
22134  *
22135  * def matvec(self, x, y): # <<<<<<<<<<<<<<
22136  * """
22137  * Compute the sparse matrix-vector product y = Ax
22138  */
22139  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_3matvec, 0, __pyx_n_s_SparseMatrix_matvec, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
22140  __Pyx_GOTREF(__pyx_t_3);
22141  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_matvec, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
22142  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22143 
22144  /* "superluWrappers.pyx":46
22145  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
22146  *
22147  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
22148  * """ Write the sparse matrix to a file
22149  *
22150  */
22151  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite, 0, __pyx_n_s_SparseMatrix_fwrite, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error)
22152  __Pyx_GOTREF(__pyx_t_3);
22153  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_fwrite, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
22154  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22155 
22156  /* "superluWrappers.pyx":62
22157  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
22158  *
22159  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
22160  * """ Get the CSR representation of the sparse matrix.
22161  *
22162  */
22163  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getCSRrepresentatio, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
22164  __Pyx_GOTREF(__pyx_t_3);
22165  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
22166  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22167 
22168  /* "superluWrappers.pyx":72
22169  * return (self.rowptr, self.colind, self.nzvals)
22170  *
22171  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
22172  * range_start,
22173  * range_end):
22174  */
22175  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getSubMatCSRreprese, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
22176  __Pyx_GOTREF(__pyx_t_3);
22177  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSubMatCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
22178  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22179 
22180  /* "superluWrappers.pyx":13
22181  * from libc.stdlib cimport malloc
22182  *
22183  * class SparseMatrix(object): # <<<<<<<<<<<<<<
22184  *
22185  * def __init__(self,
22186  */
22187  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SparseMatrix, __pyx_tuple__26, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error)
22188  __Pyx_GOTREF(__pyx_t_3);
22189  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SparseMatrix, __pyx_t_3) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
22190  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22191  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22192  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22193 
22194  /* "superluWrappers.pyx":219
22195  * self.X.Store = &self.storeX
22196  *
22197  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
22198  * sparseFactor):
22199  * """ Python wrapper for superlu Sparse Factor Prepare function.
22200  */
22201  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_1sparseFactorPrepare, NULL, __pyx_n_s_superluWrappers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
22202  __Pyx_GOTREF(__pyx_t_1);
22203  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorPrepare, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
22204  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22205 
22206  /* "superluWrappers.pyx":286
22207  * &info)
22208  *
22209  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
22210  * x):
22211  * """ Sparse factor solve wrappers
22212  */
22213  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_3sparseFactorSolve, NULL, __pyx_n_s_superluWrappers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
22214  __Pyx_GOTREF(__pyx_t_1);
22215  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorSolve, __pyx_t_1) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
22216  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22217 
22218  /* "superluWrappers.pyx":1
22219  * #cython: boundscheck=False, wraparound=False, nonecheck=False, initializedcheck=False # <<<<<<<<<<<<<<
22220  *
22221  * # ARB - the cython directives above allow code to run much faster. it is worth noting
22222  */
22223  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22224  __Pyx_GOTREF(__pyx_t_1);
22225  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22226  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22227 
22228  /* "View.MemoryView":209
22229  * info.obj = self
22230  *
22231  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22232  *
22233  * def __dealloc__(array self):
22234  */
22235  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
22236  __Pyx_GOTREF(__pyx_t_1);
22237  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
22238  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22239  PyType_Modified(__pyx_array_type);
22240 
22241  /* "View.MemoryView":286
22242  * return self.name
22243  *
22244  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22245  * cdef strided = Enum("<strided and direct>") # default
22246  * cdef indirect = Enum("<strided and indirect>")
22247  */
22248  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
22249  __Pyx_GOTREF(__pyx_t_1);
22250  __Pyx_XGOTREF(generic);
22251  __Pyx_DECREF_SET(generic, __pyx_t_1);
22252  __Pyx_GIVEREF(__pyx_t_1);
22253  __pyx_t_1 = 0;
22254 
22255  /* "View.MemoryView":287
22256  *
22257  * cdef generic = Enum("<strided and direct or indirect>")
22258  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22259  * cdef indirect = Enum("<strided and indirect>")
22260  *
22261  */
22262  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
22263  __Pyx_GOTREF(__pyx_t_1);
22264  __Pyx_XGOTREF(strided);
22265  __Pyx_DECREF_SET(strided, __pyx_t_1);
22266  __Pyx_GIVEREF(__pyx_t_1);
22267  __pyx_t_1 = 0;
22268 
22269  /* "View.MemoryView":288
22270  * cdef generic = Enum("<strided and direct or indirect>")
22271  * cdef strided = Enum("<strided and direct>") # default
22272  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22273  *
22274  *
22275  */
22276  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
22277  __Pyx_GOTREF(__pyx_t_1);
22278  __Pyx_XGOTREF(indirect);
22279  __Pyx_DECREF_SET(indirect, __pyx_t_1);
22280  __Pyx_GIVEREF(__pyx_t_1);
22281  __pyx_t_1 = 0;
22282 
22283  /* "View.MemoryView":291
22284  *
22285  *
22286  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22287  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22288  *
22289  */
22290  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
22291  __Pyx_GOTREF(__pyx_t_1);
22292  __Pyx_XGOTREF(contiguous);
22293  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
22294  __Pyx_GIVEREF(__pyx_t_1);
22295  __pyx_t_1 = 0;
22296 
22297  /* "View.MemoryView":292
22298  *
22299  * cdef contiguous = Enum("<contiguous and direct>")
22300  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22301  *
22302  *
22303  */
22304  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
22305  __Pyx_GOTREF(__pyx_t_1);
22306  __Pyx_XGOTREF(indirect_contiguous);
22307  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
22308  __Pyx_GIVEREF(__pyx_t_1);
22309  __pyx_t_1 = 0;
22310 
22311  /* "View.MemoryView":316
22312  *
22313  * DEF THREAD_LOCKS_PREALLOCATED = 8
22314  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
22315  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
22316  * PyThread_allocate_lock(),
22317  */
22318  __pyx_memoryview_thread_locks_used = 0;
22319 
22320  /* "View.MemoryView":317
22321  * DEF THREAD_LOCKS_PREALLOCATED = 8
22322  * cdef int __pyx_memoryview_thread_locks_used = 0
22323  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
22324  * PyThread_allocate_lock(),
22325  * PyThread_allocate_lock(),
22326  */
22327  __pyx_t_4[0] = PyThread_allocate_lock();
22328  __pyx_t_4[1] = PyThread_allocate_lock();
22329  __pyx_t_4[2] = PyThread_allocate_lock();
22330  __pyx_t_4[3] = PyThread_allocate_lock();
22331  __pyx_t_4[4] = PyThread_allocate_lock();
22332  __pyx_t_4[5] = PyThread_allocate_lock();
22333  __pyx_t_4[6] = PyThread_allocate_lock();
22334  __pyx_t_4[7] = PyThread_allocate_lock();
22335  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
22336 
22337  /* "View.MemoryView":549
22338  * info.obj = self
22339  *
22340  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22341  *
22342  *
22343  */
22344  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
22345  __Pyx_GOTREF(__pyx_t_1);
22346  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
22347  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22348  PyType_Modified(__pyx_memoryview_type);
22349 
22350  /* "View.MemoryView":995
22351  * return self.from_object
22352  *
22353  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22354  *
22355  *
22356  */
22357  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
22358  __Pyx_GOTREF(__pyx_t_1);
22359  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
22360  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22361  PyType_Modified(__pyx_memoryviewslice_type);
22362 
22363  /* "(tree fragment)":1
22364  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22365  * cdef object __pyx_PickleError
22366  * cdef object __pyx_result
22367  */
22368  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
22369  __Pyx_GOTREF(__pyx_t_1);
22370  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22371  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22372 
22373  /* "(tree fragment)":11
22374  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
22375  * return __pyx_result
22376  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
22377  * __pyx_result.name = __pyx_state[0]
22378  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
22379  */
22380 
22381  /*--- Wrapped vars code ---*/
22382 
22383  goto __pyx_L0;
22384  __pyx_L1_error:;
22385  __Pyx_XDECREF(__pyx_t_1);
22386  __Pyx_XDECREF(__pyx_t_2);
22387  __Pyx_XDECREF(__pyx_t_3);
22388  if (__pyx_m) {
22389  if (__pyx_d) {
22390  __Pyx_AddTraceback("init superluWrappers", __pyx_clineno, __pyx_lineno, __pyx_filename);
22391  }
22392  Py_CLEAR(__pyx_m);
22393  } else if (!PyErr_Occurred()) {
22394  PyErr_SetString(PyExc_ImportError, "init superluWrappers");
22395  }
22396  __pyx_L0:;
22397  __Pyx_RefNannyFinishContext();
22398  #if CYTHON_PEP489_MULTI_PHASE_INIT
22399  return (__pyx_m != NULL) ? 0 : -1;
22400  #elif PY_MAJOR_VERSION >= 3
22401  return __pyx_m;
22402  #else
22403  return;
22404  #endif
22405 }
22406 
22407 /* --- Runtime support code --- */
22408 /* Refnanny */
22409 #if CYTHON_REFNANNY
22410 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
22411  PyObject *m = NULL, *p = NULL;
22412  void *r = NULL;
22413  m = PyImport_ImportModule(modname);
22414  if (!m) goto end;
22415  p = PyObject_GetAttrString(m, "RefNannyAPI");
22416  if (!p) goto end;
22417  r = PyLong_AsVoidPtr(p);
22418 end:
22419  Py_XDECREF(p);
22420  Py_XDECREF(m);
22421  return (__Pyx_RefNannyAPIStruct *)r;
22422 }
22423 #endif
22424 
22425 /* PyObjectGetAttrStr */
22426 #if CYTHON_USE_TYPE_SLOTS
22427 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
22428  PyTypeObject* tp = Py_TYPE(obj);
22429  if (likely(tp->tp_getattro))
22430  return tp->tp_getattro(obj, attr_name);
22431 #if PY_MAJOR_VERSION < 3
22432  if (likely(tp->tp_getattr))
22433  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
22434 #endif
22435  return PyObject_GetAttr(obj, attr_name);
22436 }
22437 #endif
22438 
22439 /* GetBuiltinName */
22440 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
22441  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
22442  if (unlikely(!result)) {
22443  PyErr_Format(PyExc_NameError,
22444 #if PY_MAJOR_VERSION >= 3
22445  "name '%U' is not defined", name);
22446 #else
22447  "name '%.200s' is not defined", PyString_AS_STRING(name));
22448 #endif
22449  }
22450  return result;
22451 }
22452 
22453 /* RaiseArgTupleInvalid */
22454 static void __Pyx_RaiseArgtupleInvalid(
22455  const char* func_name,
22456  int exact,
22457  Py_ssize_t num_min,
22458  Py_ssize_t num_max,
22459  Py_ssize_t num_found)
22460 {
22461  Py_ssize_t num_expected;
22462  const char *more_or_less;
22463  if (num_found < num_min) {
22464  num_expected = num_min;
22465  more_or_less = "at least";
22466  } else {
22467  num_expected = num_max;
22468  more_or_less = "at most";
22469  }
22470  if (exact) {
22471  more_or_less = "exactly";
22472  }
22473  PyErr_Format(PyExc_TypeError,
22474  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
22475  func_name, more_or_less, num_expected,
22476  (num_expected == 1) ? "" : "s", num_found);
22477 }
22478 
22479 /* RaiseDoubleKeywords */
22480 static void __Pyx_RaiseDoubleKeywordsError(
22481  const char* func_name,
22482  PyObject* kw_name)
22483 {
22484  PyErr_Format(PyExc_TypeError,
22485  #if PY_MAJOR_VERSION >= 3
22486  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
22487  #else
22488  "%s() got multiple values for keyword argument '%s'", func_name,
22489  PyString_AsString(kw_name));
22490  #endif
22491 }
22492 
22493 /* ParseKeywords */
22494 static int __Pyx_ParseOptionalKeywords(
22495  PyObject *kwds,
22496  PyObject **argnames[],
22497  PyObject *kwds2,
22498  PyObject *values[],
22499  Py_ssize_t num_pos_args,
22500  const char* function_name)
22501 {
22502  PyObject *key = 0, *value = 0;
22503  Py_ssize_t pos = 0;
22504  PyObject*** name;
22505  PyObject*** first_kw_arg = argnames + num_pos_args;
22506  while (PyDict_Next(kwds, &pos, &key, &value)) {
22507  name = first_kw_arg;
22508  while (*name && (**name != key)) name++;
22509  if (*name) {
22510  values[name-argnames] = value;
22511  continue;
22512  }
22513  name = first_kw_arg;
22514  #if PY_MAJOR_VERSION < 3
22515  if (likely(PyString_Check(key))) {
22516  while (*name) {
22517  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
22518  && _PyString_Eq(**name, key)) {
22519  values[name-argnames] = value;
22520  break;
22521  }
22522  name++;
22523  }
22524  if (*name) continue;
22525  else {
22526  PyObject*** argname = argnames;
22527  while (argname != first_kw_arg) {
22528  if ((**argname == key) || (
22529  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
22530  && _PyString_Eq(**argname, key))) {
22531  goto arg_passed_twice;
22532  }
22533  argname++;
22534  }
22535  }
22536  } else
22537  #endif
22538  if (likely(PyUnicode_Check(key))) {
22539  while (*name) {
22540  int cmp = (**name == key) ? 0 :
22541  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
22542  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
22543  #endif
22544  PyUnicode_Compare(**name, key);
22545  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
22546  if (cmp == 0) {
22547  values[name-argnames] = value;
22548  break;
22549  }
22550  name++;
22551  }
22552  if (*name) continue;
22553  else {
22554  PyObject*** argname = argnames;
22555  while (argname != first_kw_arg) {
22556  int cmp = (**argname == key) ? 0 :
22557  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
22558  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
22559  #endif
22560  PyUnicode_Compare(**argname, key);
22561  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
22562  if (cmp == 0) goto arg_passed_twice;
22563  argname++;
22564  }
22565  }
22566  } else
22567  goto invalid_keyword_type;
22568  if (kwds2) {
22569  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
22570  } else {
22571  goto invalid_keyword;
22572  }
22573  }
22574  return 0;
22575 arg_passed_twice:
22576  __Pyx_RaiseDoubleKeywordsError(function_name, key);
22577  goto bad;
22578 invalid_keyword_type:
22579  PyErr_Format(PyExc_TypeError,
22580  "%.200s() keywords must be strings", function_name);
22581  goto bad;
22582 invalid_keyword:
22583  PyErr_Format(PyExc_TypeError,
22584  #if PY_MAJOR_VERSION < 3
22585  "%.200s() got an unexpected keyword argument '%.200s'",
22586  function_name, PyString_AsString(key));
22587  #else
22588  "%s() got an unexpected keyword argument '%U'",
22589  function_name, key);
22590  #endif
22591 bad:
22592  return -1;
22593 }
22594 
22595 /* PyObjectSetAttrStr */
22596 #if CYTHON_USE_TYPE_SLOTS
22597 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
22598  PyTypeObject* tp = Py_TYPE(obj);
22599  if (likely(tp->tp_setattro))
22600  return tp->tp_setattro(obj, attr_name, value);
22601 #if PY_MAJOR_VERSION < 3
22602  if (likely(tp->tp_setattr))
22603  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
22604 #endif
22605  return PyObject_SetAttr(obj, attr_name, value);
22606 }
22607 #endif
22608 
22609 /* PyObjectCall */
22610 #if CYTHON_COMPILING_IN_CPYTHON
22611 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
22612  PyObject *result;
22613  ternaryfunc call = Py_TYPE(func)->tp_call;
22614  if (unlikely(!call))
22615  return PyObject_Call(func, arg, kw);
22616  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
22617  return NULL;
22618  result = (*call)(func, arg, kw);
22619  Py_LeaveRecursiveCall();
22620  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22621  PyErr_SetString(
22622  PyExc_SystemError,
22623  "NULL result without error in PyObject_Call");
22624  }
22625  return result;
22626 }
22627 #endif
22628 
22629 /* ExtTypeTest */
22630 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
22631  if (unlikely(!type)) {
22632  PyErr_SetString(PyExc_SystemError, "Missing type object");
22633  return 0;
22634  }
22635  if (likely(__Pyx_TypeCheck(obj, type)))
22636  return 1;
22637  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
22638  Py_TYPE(obj)->tp_name, type->tp_name);
22639  return 0;
22640 }
22641 
22642 /* MemviewSliceInit */
22643 static int
22644 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
22645  int ndim,
22646  __Pyx_memviewslice *memviewslice,
22647  int memview_is_new_reference)
22648 {
22649  __Pyx_RefNannyDeclarations
22650  int i, retval=-1;
22651  Py_buffer *buf = &memview->view;
22652  __Pyx_RefNannySetupContext("init_memviewslice", 0);
22653  if (unlikely(memviewslice->memview || memviewslice->data)) {
22654  PyErr_SetString(PyExc_ValueError,
22655  "memviewslice is already initialized!");
22656  goto fail;
22657  }
22658  if (buf->strides) {
22659  for (i = 0; i < ndim; i++) {
22660  memviewslice->strides[i] = buf->strides[i];
22661  }
22662  } else {
22663  Py_ssize_t stride = buf->itemsize;
22664  for (i = ndim - 1; i >= 0; i--) {
22665  memviewslice->strides[i] = stride;
22666  stride *= buf->shape[i];
22667  }
22668  }
22669  for (i = 0; i < ndim; i++) {
22670  memviewslice->shape[i] = buf->shape[i];
22671  if (buf->suboffsets) {
22672  memviewslice->suboffsets[i] = buf->suboffsets[i];
22673  } else {
22674  memviewslice->suboffsets[i] = -1;
22675  }
22676  }
22677  memviewslice->memview = memview;
22678  memviewslice->data = (char *)buf->buf;
22679  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
22680  Py_INCREF(memview);
22681  }
22682  retval = 0;
22683  goto no_fail;
22684 fail:
22685  memviewslice->memview = 0;
22686  memviewslice->data = 0;
22687  retval = -1;
22688 no_fail:
22689  __Pyx_RefNannyFinishContext();
22690  return retval;
22691 }
22692 #ifndef Py_NO_RETURN
22693 #define Py_NO_RETURN
22694 #endif
22695 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
22696  va_list vargs;
22697  char msg[200];
22698 #ifdef HAVE_STDARG_PROTOTYPES
22699  va_start(vargs, fmt);
22700 #else
22701  va_start(vargs);
22702 #endif
22703  vsnprintf(msg, 200, fmt, vargs);
22704  va_end(vargs);
22705  Py_FatalError(msg);
22706 }
22707 static CYTHON_INLINE int
22708 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
22709  PyThread_type_lock lock)
22710 {
22711  int result;
22712  PyThread_acquire_lock(lock, 1);
22713  result = (*acquisition_count)++;
22714  PyThread_release_lock(lock);
22715  return result;
22716 }
22717 static CYTHON_INLINE int
22718 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
22719  PyThread_type_lock lock)
22720 {
22721  int result;
22722  PyThread_acquire_lock(lock, 1);
22723  result = (*acquisition_count)--;
22724  PyThread_release_lock(lock);
22725  return result;
22726 }
22727 static CYTHON_INLINE void
22728 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
22729 {
22730  int first_time;
22731  struct __pyx_memoryview_obj *memview = memslice->memview;
22732  if (unlikely(!memview || (PyObject *) memview == Py_None))
22733  return;
22734  if (unlikely(__pyx_get_slice_count(memview) < 0))
22735  __pyx_fatalerror("Acquisition count is %d (line %d)",
22736  __pyx_get_slice_count(memview), lineno);
22737  first_time = __pyx_add_acquisition_count(memview) == 0;
22738  if (unlikely(first_time)) {
22739  if (have_gil) {
22740  Py_INCREF((PyObject *) memview);
22741  } else {
22742  PyGILState_STATE _gilstate = PyGILState_Ensure();
22743  Py_INCREF((PyObject *) memview);
22744  PyGILState_Release(_gilstate);
22745  }
22746  }
22747 }
22748 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
22749  int have_gil, int lineno) {
22750  int last_time;
22751  struct __pyx_memoryview_obj *memview = memslice->memview;
22752  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
22753  memslice->memview = NULL;
22754  return;
22755  }
22756  if (unlikely(__pyx_get_slice_count(memview) <= 0))
22757  __pyx_fatalerror("Acquisition count is %d (line %d)",
22758  __pyx_get_slice_count(memview), lineno);
22759  last_time = __pyx_sub_acquisition_count(memview) == 1;
22760  memslice->data = NULL;
22761  if (unlikely(last_time)) {
22762  if (have_gil) {
22763  Py_CLEAR(memslice->memview);
22764  } else {
22765  PyGILState_STATE _gilstate = PyGILState_Ensure();
22766  Py_CLEAR(memslice->memview);
22767  PyGILState_Release(_gilstate);
22768  }
22769  } else {
22770  memslice->memview = NULL;
22771  }
22772 }
22773 
22774 /* PyFunctionFastCall */
22775 #if CYTHON_FAST_PYCALL
22776 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
22777  PyObject *globals) {
22778  PyFrameObject *f;
22779  PyThreadState *tstate = __Pyx_PyThreadState_Current;
22780  PyObject **fastlocals;
22781  Py_ssize_t i;
22782  PyObject *result;
22783  assert(globals != NULL);
22784  /* XXX Perhaps we should create a specialized
22785  PyFrame_New() that doesn't take locals, but does
22786  take builtins without sanity checking them.
22787  */
22788  assert(tstate != NULL);
22789  f = PyFrame_New(tstate, co, globals, NULL);
22790  if (f == NULL) {
22791  return NULL;
22792  }
22793  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
22794  for (i = 0; i < na; i++) {
22795  Py_INCREF(*args);
22796  fastlocals[i] = *args++;
22797  }
22798  result = PyEval_EvalFrameEx(f,0);
22799  ++tstate->recursion_depth;
22800  Py_DECREF(f);
22801  --tstate->recursion_depth;
22802  return result;
22803 }
22804 #if 1 || PY_VERSION_HEX < 0x030600B1
22805 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
22806  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
22807  PyObject *globals = PyFunction_GET_GLOBALS(func);
22808  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
22809  PyObject *closure;
22810 #if PY_MAJOR_VERSION >= 3
22811  PyObject *kwdefs;
22812 #endif
22813  PyObject *kwtuple, **k;
22814  PyObject **d;
22815  Py_ssize_t nd;
22816  Py_ssize_t nk;
22817  PyObject *result;
22818  assert(kwargs == NULL || PyDict_Check(kwargs));
22819  nk = kwargs ? PyDict_Size(kwargs) : 0;
22820  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
22821  return NULL;
22822  }
22823  if (
22824 #if PY_MAJOR_VERSION >= 3
22825  co->co_kwonlyargcount == 0 &&
22826 #endif
22827  likely(kwargs == NULL || nk == 0) &&
22828  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
22829  if (argdefs == NULL && co->co_argcount == nargs) {
22830  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
22831  goto done;
22832  }
22833  else if (nargs == 0 && argdefs != NULL
22834  && co->co_argcount == Py_SIZE(argdefs)) {
22835  /* function called with no arguments, but all parameters have
22836  a default value: use default values as arguments .*/
22837  args = &PyTuple_GET_ITEM(argdefs, 0);
22838  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
22839  goto done;
22840  }
22841  }
22842  if (kwargs != NULL) {
22843  Py_ssize_t pos, i;
22844  kwtuple = PyTuple_New(2 * nk);
22845  if (kwtuple == NULL) {
22846  result = NULL;
22847  goto done;
22848  }
22849  k = &PyTuple_GET_ITEM(kwtuple, 0);
22850  pos = i = 0;
22851  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
22852  Py_INCREF(k[i]);
22853  Py_INCREF(k[i+1]);
22854  i += 2;
22855  }
22856  nk = i / 2;
22857  }
22858  else {
22859  kwtuple = NULL;
22860  k = NULL;
22861  }
22862  closure = PyFunction_GET_CLOSURE(func);
22863 #if PY_MAJOR_VERSION >= 3
22864  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
22865 #endif
22866  if (argdefs != NULL) {
22867  d = &PyTuple_GET_ITEM(argdefs, 0);
22868  nd = Py_SIZE(argdefs);
22869  }
22870  else {
22871  d = NULL;
22872  nd = 0;
22873  }
22874 #if PY_MAJOR_VERSION >= 3
22875  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
22876  args, (int)nargs,
22877  k, (int)nk,
22878  d, (int)nd, kwdefs, closure);
22879 #else
22880  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
22881  args, (int)nargs,
22882  k, (int)nk,
22883  d, (int)nd, closure);
22884 #endif
22885  Py_XDECREF(kwtuple);
22886 done:
22887  Py_LeaveRecursiveCall();
22888  return result;
22889 }
22890 #endif
22891 #endif
22892 
22893 /* PyObjectCallMethO */
22894 #if CYTHON_COMPILING_IN_CPYTHON
22895 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
22896  PyObject *self, *result;
22897  PyCFunction cfunc;
22898  cfunc = PyCFunction_GET_FUNCTION(func);
22899  self = PyCFunction_GET_SELF(func);
22900  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
22901  return NULL;
22902  result = cfunc(self, arg);
22903  Py_LeaveRecursiveCall();
22904  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22905  PyErr_SetString(
22906  PyExc_SystemError,
22907  "NULL result without error in PyObject_Call");
22908  }
22909  return result;
22910 }
22911 #endif
22912 
22913 /* PyObjectCallNoArg */
22914 #if CYTHON_COMPILING_IN_CPYTHON
22915 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
22916 #if CYTHON_FAST_PYCALL
22917  if (PyFunction_Check(func)) {
22918  return __Pyx_PyFunction_FastCall(func, NULL, 0);
22919  }
22920 #endif
22921 #ifdef __Pyx_CyFunction_USED
22922  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
22923 #else
22924  if (likely(PyCFunction_Check(func)))
22925 #endif
22926  {
22927  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
22928  return __Pyx_PyObject_CallMethO(func, NULL);
22929  }
22930  }
22931  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
22932 }
22933 #endif
22934 
22935 /* PyCFunctionFastCall */
22936 #if CYTHON_FAST_PYCCALL
22937 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
22938  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
22939  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
22940  PyObject *self = PyCFunction_GET_SELF(func);
22941  int flags = PyCFunction_GET_FLAGS(func);
22942  assert(PyCFunction_Check(func));
22943  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
22944  assert(nargs >= 0);
22945  assert(nargs == 0 || args != NULL);
22946  /* _PyCFunction_FastCallDict() must not be called with an exception set,
22947  because it may clear it (directly or indirectly) and so the
22948  caller loses its exception */
22949  assert(!PyErr_Occurred());
22950  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
22951  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
22952  } else {
22953  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
22954  }
22955 }
22956 #endif
22957 
22958 /* PyObjectCallOneArg */
22959 #if CYTHON_COMPILING_IN_CPYTHON
22960 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22961  PyObject *result;
22962  PyObject *args = PyTuple_New(1);
22963  if (unlikely(!args)) return NULL;
22964  Py_INCREF(arg);
22965  PyTuple_SET_ITEM(args, 0, arg);
22966  result = __Pyx_PyObject_Call(func, args, NULL);
22967  Py_DECREF(args);
22968  return result;
22969 }
22970 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22971 #if CYTHON_FAST_PYCALL
22972  if (PyFunction_Check(func)) {
22973  return __Pyx_PyFunction_FastCall(func, &arg, 1);
22974  }
22975 #endif
22976  if (likely(PyCFunction_Check(func))) {
22977  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
22978  return __Pyx_PyObject_CallMethO(func, arg);
22979 #if CYTHON_FAST_PYCCALL
22980  } else if (__Pyx_PyFastCFunction_Check(func)) {
22981  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
22982 #endif
22983  }
22984  }
22985  return __Pyx__PyObject_CallOneArg(func, arg);
22986 }
22987 #else
22988 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22989  PyObject *result;
22990  PyObject *args = PyTuple_Pack(1, arg);
22991  if (unlikely(!args)) return NULL;
22992  result = __Pyx_PyObject_Call(func, args, NULL);
22993  Py_DECREF(args);
22994  return result;
22995 }
22996 #endif
22997 
22998 /* GetItemInt */
22999 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
23000  PyObject *r;
23001  if (!j) return NULL;
23002  r = PyObject_GetItem(o, j);
23003  Py_DECREF(j);
23004  return r;
23005 }
23006 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
23007  CYTHON_NCP_UNUSED int wraparound,
23008  CYTHON_NCP_UNUSED int boundscheck) {
23009 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23010  Py_ssize_t wrapped_i = i;
23011  if (wraparound & unlikely(i < 0)) {
23012  wrapped_i += PyList_GET_SIZE(o);
23013  }
23014  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
23015  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
23016  Py_INCREF(r);
23017  return r;
23018  }
23019  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23020 #else
23021  return PySequence_GetItem(o, i);
23022 #endif
23023 }
23024 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
23025  CYTHON_NCP_UNUSED int wraparound,
23026  CYTHON_NCP_UNUSED int boundscheck) {
23027 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23028  Py_ssize_t wrapped_i = i;
23029  if (wraparound & unlikely(i < 0)) {
23030  wrapped_i += PyTuple_GET_SIZE(o);
23031  }
23032  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
23033  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
23034  Py_INCREF(r);
23035  return r;
23036  }
23037  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23038 #else
23039  return PySequence_GetItem(o, i);
23040 #endif
23041 }
23042 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
23043  CYTHON_NCP_UNUSED int wraparound,
23044  CYTHON_NCP_UNUSED int boundscheck) {
23045 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
23046  if (is_list || PyList_CheckExact(o)) {
23047  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
23048  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
23049  PyObject *r = PyList_GET_ITEM(o, n);
23050  Py_INCREF(r);
23051  return r;
23052  }
23053  }
23054  else if (PyTuple_CheckExact(o)) {
23055  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
23056  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
23057  PyObject *r = PyTuple_GET_ITEM(o, n);
23058  Py_INCREF(r);
23059  return r;
23060  }
23061  } else {
23062  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
23063  if (likely(m && m->sq_item)) {
23064  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
23065  Py_ssize_t l = m->sq_length(o);
23066  if (likely(l >= 0)) {
23067  i += l;
23068  } else {
23069  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23070  return NULL;
23071  PyErr_Clear();
23072  }
23073  }
23074  return m->sq_item(o, i);
23075  }
23076  }
23077 #else
23078  if (is_list || PySequence_Check(o)) {
23079  return PySequence_GetItem(o, i);
23080  }
23081 #endif
23082  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23083 }
23084 
23085 /* ObjectGetItem */
23086 #if CYTHON_USE_TYPE_SLOTS
23087 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
23088  PyObject *runerr;
23089  Py_ssize_t key_value;
23090  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
23091  if (unlikely(!(m && m->sq_item))) {
23092  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
23093  return NULL;
23094  }
23095  key_value = __Pyx_PyIndex_AsSsize_t(index);
23096  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
23097  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
23098  }
23099  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
23100  PyErr_Clear();
23101  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
23102  }
23103  return NULL;
23104 }
23105 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
23106  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
23107  if (likely(m && m->mp_subscript)) {
23108  return m->mp_subscript(obj, key);
23109  }
23110  return __Pyx_PyObject_GetIndex(obj, key);
23111 }
23112 #endif
23113 
23114 /* PyObjectCall2Args */
23115 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
23116  PyObject *args, *result = NULL;
23117  #if CYTHON_FAST_PYCALL
23118  if (PyFunction_Check(function)) {
23119  PyObject *args[2] = {arg1, arg2};
23120  return __Pyx_PyFunction_FastCall(function, args, 2);
23121  }
23122  #endif
23123  #if CYTHON_FAST_PYCCALL
23124  if (__Pyx_PyFastCFunction_Check(function)) {
23125  PyObject *args[2] = {arg1, arg2};
23126  return __Pyx_PyCFunction_FastCall(function, args, 2);
23127  }
23128  #endif
23129  args = PyTuple_New(2);
23130  if (unlikely(!args)) goto done;
23131  Py_INCREF(arg1);
23132  PyTuple_SET_ITEM(args, 0, arg1);
23133  Py_INCREF(arg2);
23134  PyTuple_SET_ITEM(args, 1, arg2);
23135  Py_INCREF(function);
23136  result = __Pyx_PyObject_Call(function, args, NULL);
23137  Py_DECREF(args);
23138  Py_DECREF(function);
23139 done:
23140  return result;
23141 }
23142 
23143 /* PyIntBinop */
23144 #if !CYTHON_COMPILING_IN_PYPY
23145 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
23146  (void)inplace;
23147  (void)zerodivision_check;
23148  #if PY_MAJOR_VERSION < 3
23149  if (likely(PyInt_CheckExact(op1))) {
23150  const long b = intval;
23151  long x;
23152  long a = PyInt_AS_LONG(op1);
23153  x = (long)((unsigned long)a + b);
23154  if (likely((x^a) >= 0 || (x^b) >= 0))
23155  return PyInt_FromLong(x);
23156  return PyLong_Type.tp_as_number->nb_add(op1, op2);
23157  }
23158  #endif
23159  #if CYTHON_USE_PYLONG_INTERNALS
23160  if (likely(PyLong_CheckExact(op1))) {
23161  const long b = intval;
23162  long a, x;
23163 #ifdef HAVE_LONG_LONG
23164  const PY_LONG_LONG llb = intval;
23165  PY_LONG_LONG lla, llx;
23166 #endif
23167  const digit* digits = ((PyLongObject*)op1)->ob_digit;
23168  const Py_ssize_t size = Py_SIZE(op1);
23169  if (likely(__Pyx_sst_abs(size) <= 1)) {
23170  a = likely(size) ? digits[0] : 0;
23171  if (size == -1) a = -a;
23172  } else {
23173  switch (size) {
23174  case -2:
23175  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23176  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23177  break;
23178 #ifdef HAVE_LONG_LONG
23179  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23180  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23181  goto long_long;
23182 #endif
23183  }
23184  CYTHON_FALLTHROUGH;
23185  case 2:
23186  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23187  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23188  break;
23189 #ifdef HAVE_LONG_LONG
23190  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23191  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23192  goto long_long;
23193 #endif
23194  }
23195  CYTHON_FALLTHROUGH;
23196  case -3:
23197  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23198  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23199  break;
23200 #ifdef HAVE_LONG_LONG
23201  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23202  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23203  goto long_long;
23204 #endif
23205  }
23206  CYTHON_FALLTHROUGH;
23207  case 3:
23208  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23209  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23210  break;
23211 #ifdef HAVE_LONG_LONG
23212  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23213  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23214  goto long_long;
23215 #endif
23216  }
23217  CYTHON_FALLTHROUGH;
23218  case -4:
23219  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23220  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23221  break;
23222 #ifdef HAVE_LONG_LONG
23223  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23224  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23225  goto long_long;
23226 #endif
23227  }
23228  CYTHON_FALLTHROUGH;
23229  case 4:
23230  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23231  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23232  break;
23233 #ifdef HAVE_LONG_LONG
23234  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23235  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23236  goto long_long;
23237 #endif
23238  }
23239  CYTHON_FALLTHROUGH;
23240  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
23241  }
23242  }
23243  x = a + b;
23244  return PyLong_FromLong(x);
23245 #ifdef HAVE_LONG_LONG
23246  long_long:
23247  llx = lla + llb;
23248  return PyLong_FromLongLong(llx);
23249 #endif
23250 
23251 
23252  }
23253  #endif
23254  if (PyFloat_CheckExact(op1)) {
23255  const long b = intval;
23256  double a = PyFloat_AS_DOUBLE(op1);
23257  double result;
23258  PyFPE_START_PROTECT("add", return NULL)
23259  result = ((double)a) + (double)b;
23260  PyFPE_END_PROTECT(result)
23261  return PyFloat_FromDouble(result);
23262  }
23263  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
23264 }
23265 #endif
23266 
23267 /* GetTopmostException */
23268 #if CYTHON_USE_EXC_INFO_STACK
23269 static _PyErr_StackItem *
23270 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
23271 {
23272  _PyErr_StackItem *exc_info = tstate->exc_info;
23273  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
23274  exc_info->previous_item != NULL)
23275  {
23276  exc_info = exc_info->previous_item;
23277  }
23278  return exc_info;
23279 }
23280 #endif
23281 
23282 /* SaveResetException */
23283 #if CYTHON_FAST_THREAD_STATE
23284 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23285  #if CYTHON_USE_EXC_INFO_STACK
23286  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
23287  *type = exc_info->exc_type;
23288  *value = exc_info->exc_value;
23289  *tb = exc_info->exc_traceback;
23290  #else
23291  *type = tstate->exc_type;
23292  *value = tstate->exc_value;
23293  *tb = tstate->exc_traceback;
23294  #endif
23295  Py_XINCREF(*type);
23296  Py_XINCREF(*value);
23297  Py_XINCREF(*tb);
23298 }
23299 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23300  PyObject *tmp_type, *tmp_value, *tmp_tb;
23301  #if CYTHON_USE_EXC_INFO_STACK
23302  _PyErr_StackItem *exc_info = tstate->exc_info;
23303  tmp_type = exc_info->exc_type;
23304  tmp_value = exc_info->exc_value;
23305  tmp_tb = exc_info->exc_traceback;
23306  exc_info->exc_type = type;
23307  exc_info->exc_value = value;
23308  exc_info->exc_traceback = tb;
23309  #else
23310  tmp_type = tstate->exc_type;
23311  tmp_value = tstate->exc_value;
23312  tmp_tb = tstate->exc_traceback;
23313  tstate->exc_type = type;
23314  tstate->exc_value = value;
23315  tstate->exc_traceback = tb;
23316  #endif
23317  Py_XDECREF(tmp_type);
23318  Py_XDECREF(tmp_value);
23319  Py_XDECREF(tmp_tb);
23320 }
23321 #endif
23322 
23323 /* GetException */
23324 #if CYTHON_FAST_THREAD_STATE
23325 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
23326 #else
23327 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
23328 #endif
23329 {
23330  PyObject *local_type, *local_value, *local_tb;
23331 #if CYTHON_FAST_THREAD_STATE
23332  PyObject *tmp_type, *tmp_value, *tmp_tb;
23333  local_type = tstate->curexc_type;
23334  local_value = tstate->curexc_value;
23335  local_tb = tstate->curexc_traceback;
23336  tstate->curexc_type = 0;
23337  tstate->curexc_value = 0;
23338  tstate->curexc_traceback = 0;
23339 #else
23340  PyErr_Fetch(&local_type, &local_value, &local_tb);
23341 #endif
23342  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
23343 #if CYTHON_FAST_THREAD_STATE
23344  if (unlikely(tstate->curexc_type))
23345 #else
23346  if (unlikely(PyErr_Occurred()))
23347 #endif
23348  goto bad;
23349  #if PY_MAJOR_VERSION >= 3
23350  if (local_tb) {
23351  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
23352  goto bad;
23353  }
23354  #endif
23355  Py_XINCREF(local_tb);
23356  Py_XINCREF(local_type);
23357  Py_XINCREF(local_value);
23358  *type = local_type;
23359  *value = local_value;
23360  *tb = local_tb;
23361 #if CYTHON_FAST_THREAD_STATE
23362  #if CYTHON_USE_EXC_INFO_STACK
23363  {
23364  _PyErr_StackItem *exc_info = tstate->exc_info;
23365  tmp_type = exc_info->exc_type;
23366  tmp_value = exc_info->exc_value;
23367  tmp_tb = exc_info->exc_traceback;
23368  exc_info->exc_type = local_type;
23369  exc_info->exc_value = local_value;
23370  exc_info->exc_traceback = local_tb;
23371  }
23372  #else
23373  tmp_type = tstate->exc_type;
23374  tmp_value = tstate->exc_value;
23375  tmp_tb = tstate->exc_traceback;
23376  tstate->exc_type = local_type;
23377  tstate->exc_value = local_value;
23378  tstate->exc_traceback = local_tb;
23379  #endif
23380  Py_XDECREF(tmp_type);
23381  Py_XDECREF(tmp_value);
23382  Py_XDECREF(tmp_tb);
23383 #else
23384  PyErr_SetExcInfo(local_type, local_value, local_tb);
23385 #endif
23386  return 0;
23387 bad:
23388  *type = 0;
23389  *value = 0;
23390  *tb = 0;
23391  Py_XDECREF(local_type);
23392  Py_XDECREF(local_value);
23393  Py_XDECREF(local_tb);
23394  return -1;
23395 }
23396 
23397 /* PyErrFetchRestore */
23398 #if CYTHON_FAST_THREAD_STATE
23399 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23400  PyObject *tmp_type, *tmp_value, *tmp_tb;
23401  tmp_type = tstate->curexc_type;
23402  tmp_value = tstate->curexc_value;
23403  tmp_tb = tstate->curexc_traceback;
23404  tstate->curexc_type = type;
23405  tstate->curexc_value = value;
23406  tstate->curexc_traceback = tb;
23407  Py_XDECREF(tmp_type);
23408  Py_XDECREF(tmp_value);
23409  Py_XDECREF(tmp_tb);
23410 }
23411 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23412  *type = tstate->curexc_type;
23413  *value = tstate->curexc_value;
23414  *tb = tstate->curexc_traceback;
23415  tstate->curexc_type = 0;
23416  tstate->curexc_value = 0;
23417  tstate->curexc_traceback = 0;
23418 }
23419 #endif
23420 
23421 /* SliceObject */
23422 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
23423  Py_ssize_t cstart, Py_ssize_t cstop,
23424  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
23425  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
23426 #if CYTHON_USE_TYPE_SLOTS
23427  PyMappingMethods* mp;
23428 #if PY_MAJOR_VERSION < 3
23429  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
23430  if (likely(ms && ms->sq_slice)) {
23431  if (!has_cstart) {
23432  if (_py_start && (*_py_start != Py_None)) {
23433  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
23434  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
23435  } else
23436  cstart = 0;
23437  }
23438  if (!has_cstop) {
23439  if (_py_stop && (*_py_stop != Py_None)) {
23440  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
23441  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
23442  } else
23443  cstop = PY_SSIZE_T_MAX;
23444  }
23445  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
23446  Py_ssize_t l = ms->sq_length(obj);
23447  if (likely(l >= 0)) {
23448  if (cstop < 0) {
23449  cstop += l;
23450  if (cstop < 0) cstop = 0;
23451  }
23452  if (cstart < 0) {
23453  cstart += l;
23454  if (cstart < 0) cstart = 0;
23455  }
23456  } else {
23457  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23458  goto bad;
23459  PyErr_Clear();
23460  }
23461  }
23462  return ms->sq_slice(obj, cstart, cstop);
23463  }
23464 #endif
23465  mp = Py_TYPE(obj)->tp_as_mapping;
23466  if (likely(mp && mp->mp_subscript))
23467 #endif
23468  {
23469  PyObject* result;
23470  PyObject *py_slice, *py_start, *py_stop;
23471  if (_py_slice) {
23472  py_slice = *_py_slice;
23473  } else {
23474  PyObject* owned_start = NULL;
23475  PyObject* owned_stop = NULL;
23476  if (_py_start) {
23477  py_start = *_py_start;
23478  } else {
23479  if (has_cstart) {
23480  owned_start = py_start = PyInt_FromSsize_t(cstart);
23481  if (unlikely(!py_start)) goto bad;
23482  } else
23483  py_start = Py_None;
23484  }
23485  if (_py_stop) {
23486  py_stop = *_py_stop;
23487  } else {
23488  if (has_cstop) {
23489  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
23490  if (unlikely(!py_stop)) {
23491  Py_XDECREF(owned_start);
23492  goto bad;
23493  }
23494  } else
23495  py_stop = Py_None;
23496  }
23497  py_slice = PySlice_New(py_start, py_stop, Py_None);
23498  Py_XDECREF(owned_start);
23499  Py_XDECREF(owned_stop);
23500  if (unlikely(!py_slice)) goto bad;
23501  }
23502 #if CYTHON_USE_TYPE_SLOTS
23503  result = mp->mp_subscript(obj, py_slice);
23504 #else
23505  result = PyObject_GetItem(obj, py_slice);
23506 #endif
23507  if (!_py_slice) {
23508  Py_DECREF(py_slice);
23509  }
23510  return result;
23511  }
23512  PyErr_Format(PyExc_TypeError,
23513  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
23514 bad:
23515  return NULL;
23516 }
23517 
23518 /* RaiseException */
23519 #if PY_MAJOR_VERSION < 3
23520 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
23521  CYTHON_UNUSED PyObject *cause) {
23522  __Pyx_PyThreadState_declare
23523  Py_XINCREF(type);
23524  if (!value || value == Py_None)
23525  value = NULL;
23526  else
23527  Py_INCREF(value);
23528  if (!tb || tb == Py_None)
23529  tb = NULL;
23530  else {
23531  Py_INCREF(tb);
23532  if (!PyTraceBack_Check(tb)) {
23533  PyErr_SetString(PyExc_TypeError,
23534  "raise: arg 3 must be a traceback or None");
23535  goto raise_error;
23536  }
23537  }
23538  if (PyType_Check(type)) {
23539 #if CYTHON_COMPILING_IN_PYPY
23540  if (!value) {
23541  Py_INCREF(Py_None);
23542  value = Py_None;
23543  }
23544 #endif
23545  PyErr_NormalizeException(&type, &value, &tb);
23546  } else {
23547  if (value) {
23548  PyErr_SetString(PyExc_TypeError,
23549  "instance exception may not have a separate value");
23550  goto raise_error;
23551  }
23552  value = type;
23553  type = (PyObject*) Py_TYPE(type);
23554  Py_INCREF(type);
23555  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
23556  PyErr_SetString(PyExc_TypeError,
23557  "raise: exception class must be a subclass of BaseException");
23558  goto raise_error;
23559  }
23560  }
23561  __Pyx_PyThreadState_assign
23562  __Pyx_ErrRestore(type, value, tb);
23563  return;
23564 raise_error:
23565  Py_XDECREF(value);
23566  Py_XDECREF(type);
23567  Py_XDECREF(tb);
23568  return;
23569 }
23570 #else
23571 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
23572  PyObject* owned_instance = NULL;
23573  if (tb == Py_None) {
23574  tb = 0;
23575  } else if (tb && !PyTraceBack_Check(tb)) {
23576  PyErr_SetString(PyExc_TypeError,
23577  "raise: arg 3 must be a traceback or None");
23578  goto bad;
23579  }
23580  if (value == Py_None)
23581  value = 0;
23582  if (PyExceptionInstance_Check(type)) {
23583  if (value) {
23584  PyErr_SetString(PyExc_TypeError,
23585  "instance exception may not have a separate value");
23586  goto bad;
23587  }
23588  value = type;
23589  type = (PyObject*) Py_TYPE(value);
23590  } else if (PyExceptionClass_Check(type)) {
23591  PyObject *instance_class = NULL;
23592  if (value && PyExceptionInstance_Check(value)) {
23593  instance_class = (PyObject*) Py_TYPE(value);
23594  if (instance_class != type) {
23595  int is_subclass = PyObject_IsSubclass(instance_class, type);
23596  if (!is_subclass) {
23597  instance_class = NULL;
23598  } else if (unlikely(is_subclass == -1)) {
23599  goto bad;
23600  } else {
23601  type = instance_class;
23602  }
23603  }
23604  }
23605  if (!instance_class) {
23606  PyObject *args;
23607  if (!value)
23608  args = PyTuple_New(0);
23609  else if (PyTuple_Check(value)) {
23610  Py_INCREF(value);
23611  args = value;
23612  } else
23613  args = PyTuple_Pack(1, value);
23614  if (!args)
23615  goto bad;
23616  owned_instance = PyObject_Call(type, args, NULL);
23617  Py_DECREF(args);
23618  if (!owned_instance)
23619  goto bad;
23620  value = owned_instance;
23621  if (!PyExceptionInstance_Check(value)) {
23622  PyErr_Format(PyExc_TypeError,
23623  "calling %R should have returned an instance of "
23624  "BaseException, not %R",
23625  type, Py_TYPE(value));
23626  goto bad;
23627  }
23628  }
23629  } else {
23630  PyErr_SetString(PyExc_TypeError,
23631  "raise: exception class must be a subclass of BaseException");
23632  goto bad;
23633  }
23634  if (cause) {
23635  PyObject *fixed_cause;
23636  if (cause == Py_None) {
23637  fixed_cause = NULL;
23638  } else if (PyExceptionClass_Check(cause)) {
23639  fixed_cause = PyObject_CallObject(cause, NULL);
23640  if (fixed_cause == NULL)
23641  goto bad;
23642  } else if (PyExceptionInstance_Check(cause)) {
23643  fixed_cause = cause;
23644  Py_INCREF(fixed_cause);
23645  } else {
23646  PyErr_SetString(PyExc_TypeError,
23647  "exception causes must derive from "
23648  "BaseException");
23649  goto bad;
23650  }
23651  PyException_SetCause(value, fixed_cause);
23652  }
23653  PyErr_SetObject(type, value);
23654  if (tb) {
23655 #if CYTHON_COMPILING_IN_PYPY
23656  PyObject *tmp_type, *tmp_value, *tmp_tb;
23657  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
23658  Py_INCREF(tb);
23659  PyErr_Restore(tmp_type, tmp_value, tb);
23660  Py_XDECREF(tmp_tb);
23661 #else
23662  PyThreadState *tstate = __Pyx_PyThreadState_Current;
23663  PyObject* tmp_tb = tstate->curexc_traceback;
23664  if (tb != tmp_tb) {
23665  Py_INCREF(tb);
23666  tstate->curexc_traceback = tb;
23667  Py_XDECREF(tmp_tb);
23668  }
23669 #endif
23670  }
23671 bad:
23672  Py_XDECREF(owned_instance);
23673  return;
23674 }
23675 #endif
23676 
23677 /* WriteUnraisableException */
23678 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
23679  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
23680  int full_traceback, CYTHON_UNUSED int nogil) {
23681  PyObject *old_exc, *old_val, *old_tb;
23682  PyObject *ctx;
23683  __Pyx_PyThreadState_declare
23684 #ifdef WITH_THREAD
23685  PyGILState_STATE state;
23686  if (nogil)
23687  state = PyGILState_Ensure();
23688 #ifdef _MSC_VER
23689  else state = (PyGILState_STATE)-1;
23690 #endif
23691 #endif
23692  __Pyx_PyThreadState_assign
23693  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
23694  if (full_traceback) {
23695  Py_XINCREF(old_exc);
23696  Py_XINCREF(old_val);
23697  Py_XINCREF(old_tb);
23698  __Pyx_ErrRestore(old_exc, old_val, old_tb);
23699  PyErr_PrintEx(1);
23700  }
23701  #if PY_MAJOR_VERSION < 3
23702  ctx = PyString_FromString(name);
23703  #else
23704  ctx = PyUnicode_FromString(name);
23705  #endif
23706  __Pyx_ErrRestore(old_exc, old_val, old_tb);
23707  if (!ctx) {
23708  PyErr_WriteUnraisable(Py_None);
23709  } else {
23710  PyErr_WriteUnraisable(ctx);
23711  Py_DECREF(ctx);
23712  }
23713 #ifdef WITH_THREAD
23714  if (nogil)
23715  PyGILState_Release(state);
23716 #endif
23717 }
23718 
23719 /* PyErrExceptionMatches */
23720 #if CYTHON_FAST_THREAD_STATE
23721 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
23722  Py_ssize_t i, n;
23723  n = PyTuple_GET_SIZE(tuple);
23724 #if PY_MAJOR_VERSION >= 3
23725  for (i=0; i<n; i++) {
23726  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
23727  }
23728 #endif
23729  for (i=0; i<n; i++) {
23730  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
23731  }
23732  return 0;
23733 }
23734 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
23735  PyObject *exc_type = tstate->curexc_type;
23736  if (exc_type == err) return 1;
23737  if (unlikely(!exc_type)) return 0;
23738  if (unlikely(PyTuple_Check(err)))
23739  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
23740  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
23741 }
23742 #endif
23743 
23744 /* ArgTypeTest */
23745 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
23746 {
23747  if (unlikely(!type)) {
23748  PyErr_SetString(PyExc_SystemError, "Missing type object");
23749  return 0;
23750  }
23751  else if (exact) {
23752  #if PY_MAJOR_VERSION == 2
23753  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
23754  #endif
23755  }
23756  else {
23757  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
23758  }
23759  PyErr_Format(PyExc_TypeError,
23760  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23761  name, type->tp_name, Py_TYPE(obj)->tp_name);
23762  return 0;
23763 }
23764 
23765 /* BytesEquals */
23766 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
23767 #if CYTHON_COMPILING_IN_PYPY
23768  return PyObject_RichCompareBool(s1, s2, equals);
23769 #else
23770  if (s1 == s2) {
23771  return (equals == Py_EQ);
23772  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
23773  const char *ps1, *ps2;
23774  Py_ssize_t length = PyBytes_GET_SIZE(s1);
23775  if (length != PyBytes_GET_SIZE(s2))
23776  return (equals == Py_NE);
23777  ps1 = PyBytes_AS_STRING(s1);
23778  ps2 = PyBytes_AS_STRING(s2);
23779  if (ps1[0] != ps2[0]) {
23780  return (equals == Py_NE);
23781  } else if (length == 1) {
23782  return (equals == Py_EQ);
23783  } else {
23784  int result;
23785 #if CYTHON_USE_UNICODE_INTERNALS
23786  Py_hash_t hash1, hash2;
23787  hash1 = ((PyBytesObject*)s1)->ob_shash;
23788  hash2 = ((PyBytesObject*)s2)->ob_shash;
23789  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23790  return (equals == Py_NE);
23791  }
23792 #endif
23793  result = memcmp(ps1, ps2, (size_t)length);
23794  return (equals == Py_EQ) ? (result == 0) : (result != 0);
23795  }
23796  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
23797  return (equals == Py_NE);
23798  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
23799  return (equals == Py_NE);
23800  } else {
23801  int result;
23802  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23803  if (!py_result)
23804  return -1;
23805  result = __Pyx_PyObject_IsTrue(py_result);
23806  Py_DECREF(py_result);
23807  return result;
23808  }
23809 #endif
23810 }
23811 
23812 /* UnicodeEquals */
23813 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
23814 #if CYTHON_COMPILING_IN_PYPY
23815  return PyObject_RichCompareBool(s1, s2, equals);
23816 #else
23817 #if PY_MAJOR_VERSION < 3
23818  PyObject* owned_ref = NULL;
23819 #endif
23820  int s1_is_unicode, s2_is_unicode;
23821  if (s1 == s2) {
23822  goto return_eq;
23823  }
23824  s1_is_unicode = PyUnicode_CheckExact(s1);
23825  s2_is_unicode = PyUnicode_CheckExact(s2);
23826 #if PY_MAJOR_VERSION < 3
23827  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
23828  owned_ref = PyUnicode_FromObject(s2);
23829  if (unlikely(!owned_ref))
23830  return -1;
23831  s2 = owned_ref;
23832  s2_is_unicode = 1;
23833  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
23834  owned_ref = PyUnicode_FromObject(s1);
23835  if (unlikely(!owned_ref))
23836  return -1;
23837  s1 = owned_ref;
23838  s1_is_unicode = 1;
23839  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
23840  return __Pyx_PyBytes_Equals(s1, s2, equals);
23841  }
23842 #endif
23843  if (s1_is_unicode & s2_is_unicode) {
23844  Py_ssize_t length;
23845  int kind;
23846  void *data1, *data2;
23847  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
23848  return -1;
23849  length = __Pyx_PyUnicode_GET_LENGTH(s1);
23850  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
23851  goto return_ne;
23852  }
23853 #if CYTHON_USE_UNICODE_INTERNALS
23854  {
23855  Py_hash_t hash1, hash2;
23856  #if CYTHON_PEP393_ENABLED
23857  hash1 = ((PyASCIIObject*)s1)->hash;
23858  hash2 = ((PyASCIIObject*)s2)->hash;
23859  #else
23860  hash1 = ((PyUnicodeObject*)s1)->hash;
23861  hash2 = ((PyUnicodeObject*)s2)->hash;
23862  #endif
23863  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23864  goto return_ne;
23865  }
23866  }
23867 #endif
23868  kind = __Pyx_PyUnicode_KIND(s1);
23869  if (kind != __Pyx_PyUnicode_KIND(s2)) {
23870  goto return_ne;
23871  }
23872  data1 = __Pyx_PyUnicode_DATA(s1);
23873  data2 = __Pyx_PyUnicode_DATA(s2);
23874  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
23875  goto return_ne;
23876  } else if (length == 1) {
23877  goto return_eq;
23878  } else {
23879  int result = memcmp(data1, data2, (size_t)(length * kind));
23880  #if PY_MAJOR_VERSION < 3
23881  Py_XDECREF(owned_ref);
23882  #endif
23883  return (equals == Py_EQ) ? (result == 0) : (result != 0);
23884  }
23885  } else if ((s1 == Py_None) & s2_is_unicode) {
23886  goto return_ne;
23887  } else if ((s2 == Py_None) & s1_is_unicode) {
23888  goto return_ne;
23889  } else {
23890  int result;
23891  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23892  #if PY_MAJOR_VERSION < 3
23893  Py_XDECREF(owned_ref);
23894  #endif
23895  if (!py_result)
23896  return -1;
23897  result = __Pyx_PyObject_IsTrue(py_result);
23898  Py_DECREF(py_result);
23899  return result;
23900  }
23901 return_eq:
23902  #if PY_MAJOR_VERSION < 3
23903  Py_XDECREF(owned_ref);
23904  #endif
23905  return (equals == Py_EQ);
23906 return_ne:
23907  #if PY_MAJOR_VERSION < 3
23908  Py_XDECREF(owned_ref);
23909  #endif
23910  return (equals == Py_NE);
23911 #endif
23912 }
23913 
23914 /* None */
23915 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
23916  Py_ssize_t q = a / b;
23917  Py_ssize_t r = a - q*b;
23918  q -= ((r != 0) & ((r ^ b) < 0));
23919  return q;
23920 }
23921 
23922 /* GetAttr */
23923 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
23924 #if CYTHON_USE_TYPE_SLOTS
23925 #if PY_MAJOR_VERSION >= 3
23926  if (likely(PyUnicode_Check(n)))
23927 #else
23928  if (likely(PyString_Check(n)))
23929 #endif
23930  return __Pyx_PyObject_GetAttrStr(o, n);
23931 #endif
23932  return PyObject_GetAttr(o, n);
23933 }
23934 
23935 /* decode_c_string */
23936 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
23937  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
23938  const char* encoding, const char* errors,
23939  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
23940  Py_ssize_t length;
23941  if (unlikely((start < 0) | (stop < 0))) {
23942  size_t slen = strlen(cstring);
23943  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
23944  PyErr_SetString(PyExc_OverflowError,
23945  "c-string too long to convert to Python");
23946  return NULL;
23947  }
23948  length = (Py_ssize_t) slen;
23949  if (start < 0) {
23950  start += length;
23951  if (start < 0)
23952  start = 0;
23953  }
23954  if (stop < 0)
23955  stop += length;
23956  }
23957  if (unlikely(stop <= start))
23958  return __Pyx_NewRef(__pyx_empty_unicode);
23959  length = stop - start;
23960  cstring += start;
23961  if (decode_func) {
23962  return decode_func(cstring, length, errors);
23963  } else {
23964  return PyUnicode_Decode(cstring, length, encoding, errors);
23965  }
23966 }
23967 
23968 /* GetAttr3 */
23969 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
23970  __Pyx_PyThreadState_declare
23971  __Pyx_PyThreadState_assign
23972  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
23973  return NULL;
23974  __Pyx_PyErr_Clear();
23975  Py_INCREF(d);
23976  return d;
23977 }
23978 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
23979  PyObject *r = __Pyx_GetAttr(o, n);
23980  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
23981 }
23982 
23983 /* PyDictVersioning */
23984 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
23985 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
23986  PyObject *dict = Py_TYPE(obj)->tp_dict;
23987  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
23988 }
23989 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
23990  PyObject **dictptr = NULL;
23991  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
23992  if (offset) {
23993 #if CYTHON_COMPILING_IN_CPYTHON
23994  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
23995 #else
23996  dictptr = _PyObject_GetDictPtr(obj);
23997 #endif
23998  }
23999  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24000 }
24001 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24002  PyObject *dict = Py_TYPE(obj)->tp_dict;
24003  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24004  return 0;
24005  return obj_dict_version == __Pyx_get_object_dict_version(obj);
24006 }
24007 #endif
24008 
24009 /* GetModuleGlobalName */
24010 #if CYTHON_USE_DICT_VERSIONS
24011 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24012 #else
24013 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24014 #endif
24015 {
24016  PyObject *result;
24017 #if !CYTHON_AVOID_BORROWED_REFS
24018 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24019  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24020  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24021  if (likely(result)) {
24022  return __Pyx_NewRef(result);
24023  } else if (unlikely(PyErr_Occurred())) {
24024  return NULL;
24025  }
24026 #else
24027  result = PyDict_GetItem(__pyx_d, name);
24028  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24029  if (likely(result)) {
24030  return __Pyx_NewRef(result);
24031  }
24032 #endif
24033 #else
24034  result = PyObject_GetItem(__pyx_d, name);
24035  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24036  if (likely(result)) {
24037  return __Pyx_NewRef(result);
24038  }
24039  PyErr_Clear();
24040 #endif
24041  return __Pyx_GetBuiltinName(name);
24042 }
24043 
24044 /* RaiseTooManyValuesToUnpack */
24045 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24046  PyErr_Format(PyExc_ValueError,
24047  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
24048 }
24049 
24050 /* RaiseNeedMoreValuesToUnpack */
24051 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24052  PyErr_Format(PyExc_ValueError,
24053  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
24054  index, (index == 1) ? "" : "s");
24055 }
24056 
24057 /* RaiseNoneIterError */
24058 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
24059  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
24060 }
24061 
24062 /* SwapException */
24063 #if CYTHON_FAST_THREAD_STATE
24064 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24065  PyObject *tmp_type, *tmp_value, *tmp_tb;
24066  #if CYTHON_USE_EXC_INFO_STACK
24067  _PyErr_StackItem *exc_info = tstate->exc_info;
24068  tmp_type = exc_info->exc_type;
24069  tmp_value = exc_info->exc_value;
24070  tmp_tb = exc_info->exc_traceback;
24071  exc_info->exc_type = *type;
24072  exc_info->exc_value = *value;
24073  exc_info->exc_traceback = *tb;
24074  #else
24075  tmp_type = tstate->exc_type;
24076  tmp_value = tstate->exc_value;
24077  tmp_tb = tstate->exc_traceback;
24078  tstate->exc_type = *type;
24079  tstate->exc_value = *value;
24080  tstate->exc_traceback = *tb;
24081  #endif
24082  *type = tmp_type;
24083  *value = tmp_value;
24084  *tb = tmp_tb;
24085 }
24086 #else
24087 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
24088  PyObject *tmp_type, *tmp_value, *tmp_tb;
24089  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
24090  PyErr_SetExcInfo(*type, *value, *tb);
24091  *type = tmp_type;
24092  *value = tmp_value;
24093  *tb = tmp_tb;
24094 }
24095 #endif
24096 
24097 /* Import */
24098 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
24099  PyObject *empty_list = 0;
24100  PyObject *module = 0;
24101  PyObject *global_dict = 0;
24102  PyObject *empty_dict = 0;
24103  PyObject *list;
24104  #if PY_MAJOR_VERSION < 3
24105  PyObject *py_import;
24106  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24107  if (!py_import)
24108  goto bad;
24109  #endif
24110  if (from_list)
24111  list = from_list;
24112  else {
24113  empty_list = PyList_New(0);
24114  if (!empty_list)
24115  goto bad;
24116  list = empty_list;
24117  }
24118  global_dict = PyModule_GetDict(__pyx_m);
24119  if (!global_dict)
24120  goto bad;
24121  empty_dict = PyDict_New();
24122  if (!empty_dict)
24123  goto bad;
24124  {
24125  #if PY_MAJOR_VERSION >= 3
24126  if (level == -1) {
24127  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
24128  module = PyImport_ImportModuleLevelObject(
24129  name, global_dict, empty_dict, list, 1);
24130  if (!module) {
24131  if (!PyErr_ExceptionMatches(PyExc_ImportError))
24132  goto bad;
24133  PyErr_Clear();
24134  }
24135  }
24136  level = 0;
24137  }
24138  #endif
24139  if (!module) {
24140  #if PY_MAJOR_VERSION < 3
24141  PyObject *py_level = PyInt_FromLong(level);
24142  if (!py_level)
24143  goto bad;
24144  module = PyObject_CallFunctionObjArgs(py_import,
24145  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24146  Py_DECREF(py_level);
24147  #else
24148  module = PyImport_ImportModuleLevelObject(
24149  name, global_dict, empty_dict, list, level);
24150  #endif
24151  }
24152  }
24153 bad:
24154  #if PY_MAJOR_VERSION < 3
24155  Py_XDECREF(py_import);
24156  #endif
24157  Py_XDECREF(empty_list);
24158  Py_XDECREF(empty_dict);
24159  return module;
24160 }
24161 
24162 /* FastTypeChecks */
24163 #if CYTHON_COMPILING_IN_CPYTHON
24164 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
24165  while (a) {
24166  a = a->tp_base;
24167  if (a == b)
24168  return 1;
24169  }
24170  return b == &PyBaseObject_Type;
24171 }
24172 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
24173  PyObject *mro;
24174  if (a == b) return 1;
24175  mro = a->tp_mro;
24176  if (likely(mro)) {
24177  Py_ssize_t i, n;
24178  n = PyTuple_GET_SIZE(mro);
24179  for (i = 0; i < n; i++) {
24180  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
24181  return 1;
24182  }
24183  return 0;
24184  }
24185  return __Pyx_InBases(a, b);
24186 }
24187 #if PY_MAJOR_VERSION == 2
24188 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
24189  PyObject *exception, *value, *tb;
24190  int res;
24191  __Pyx_PyThreadState_declare
24192  __Pyx_PyThreadState_assign
24193  __Pyx_ErrFetch(&exception, &value, &tb);
24194  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
24195  if (unlikely(res == -1)) {
24196  PyErr_WriteUnraisable(err);
24197  res = 0;
24198  }
24199  if (!res) {
24200  res = PyObject_IsSubclass(err, exc_type2);
24201  if (unlikely(res == -1)) {
24202  PyErr_WriteUnraisable(err);
24203  res = 0;
24204  }
24205  }
24206  __Pyx_ErrRestore(exception, value, tb);
24207  return res;
24208 }
24209 #else
24210 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
24211  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
24212  if (!res) {
24213  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
24214  }
24215  return res;
24216 }
24217 #endif
24218 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24219  Py_ssize_t i, n;
24220  assert(PyExceptionClass_Check(exc_type));
24221  n = PyTuple_GET_SIZE(tuple);
24222 #if PY_MAJOR_VERSION >= 3
24223  for (i=0; i<n; i++) {
24224  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24225  }
24226 #endif
24227  for (i=0; i<n; i++) {
24228  PyObject *t = PyTuple_GET_ITEM(tuple, i);
24229  #if PY_MAJOR_VERSION < 3
24230  if (likely(exc_type == t)) return 1;
24231  #endif
24232  if (likely(PyExceptionClass_Check(t))) {
24233  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
24234  } else {
24235  }
24236  }
24237  return 0;
24238 }
24239 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
24240  if (likely(err == exc_type)) return 1;
24241  if (likely(PyExceptionClass_Check(err))) {
24242  if (likely(PyExceptionClass_Check(exc_type))) {
24243  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
24244  } else if (likely(PyTuple_Check(exc_type))) {
24245  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
24246  } else {
24247  }
24248  }
24249  return PyErr_GivenExceptionMatches(err, exc_type);
24250 }
24251 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
24252  assert(PyExceptionClass_Check(exc_type1));
24253  assert(PyExceptionClass_Check(exc_type2));
24254  if (likely(err == exc_type1 || err == exc_type2)) return 1;
24255  if (likely(PyExceptionClass_Check(err))) {
24256  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
24257  }
24258  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
24259 }
24260 #endif
24261 
24262 /* None */
24263 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
24264  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
24265 }
24266 
24267 /* None */
24268 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
24269  long q = a / b;
24270  long r = a - q*b;
24271  q -= ((r != 0) & ((r ^ b) < 0));
24272  return q;
24273 }
24274 
24275 /* ImportFrom */
24276 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24277  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24278  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24279  PyErr_Format(PyExc_ImportError,
24280  #if PY_MAJOR_VERSION < 3
24281  "cannot import name %.230s", PyString_AS_STRING(name));
24282  #else
24283  "cannot import name %S", name);
24284  #endif
24285  }
24286  return value;
24287 }
24288 
24289 /* HasAttr */
24290 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
24291  PyObject *r;
24292  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
24293  PyErr_SetString(PyExc_TypeError,
24294  "hasattr(): attribute name must be string");
24295  return -1;
24296  }
24297  r = __Pyx_GetAttr(o, n);
24298  if (unlikely(!r)) {
24299  PyErr_Clear();
24300  return 0;
24301  } else {
24302  Py_DECREF(r);
24303  return 1;
24304  }
24305 }
24306 
24307 /* PyObject_GenericGetAttrNoDict */
24308 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24309 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
24310  PyErr_Format(PyExc_AttributeError,
24311 #if PY_MAJOR_VERSION >= 3
24312  "'%.50s' object has no attribute '%U'",
24313  tp->tp_name, attr_name);
24314 #else
24315  "'%.50s' object has no attribute '%.400s'",
24316  tp->tp_name, PyString_AS_STRING(attr_name));
24317 #endif
24318  return NULL;
24319 }
24320 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
24321  PyObject *descr;
24322  PyTypeObject *tp = Py_TYPE(obj);
24323  if (unlikely(!PyString_Check(attr_name))) {
24324  return PyObject_GenericGetAttr(obj, attr_name);
24325  }
24326  assert(!tp->tp_dictoffset);
24327  descr = _PyType_Lookup(tp, attr_name);
24328  if (unlikely(!descr)) {
24329  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
24330  }
24331  Py_INCREF(descr);
24332  #if PY_MAJOR_VERSION < 3
24333  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
24334  #endif
24335  {
24336  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
24337  if (unlikely(f)) {
24338  PyObject *res = f(descr, obj, (PyObject *)tp);
24339  Py_DECREF(descr);
24340  return res;
24341  }
24342  }
24343  return descr;
24344 }
24345 #endif
24346 
24347 /* PyObject_GenericGetAttr */
24348 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24349 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
24350  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
24351  return PyObject_GenericGetAttr(obj, attr_name);
24352  }
24353  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
24354 }
24355 #endif
24356 
24357 /* PyObjectGetAttrStrNoError */
24358 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
24359  __Pyx_PyThreadState_declare
24360  __Pyx_PyThreadState_assign
24361  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24362  __Pyx_PyErr_Clear();
24363 }
24364 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
24365  PyObject *result;
24366 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
24367  PyTypeObject* tp = Py_TYPE(obj);
24368  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
24369  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
24370  }
24371 #endif
24372  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
24373  if (unlikely(!result)) {
24374  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
24375  }
24376  return result;
24377 }
24378 
24379 /* SetupReduce */
24380 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
24381  int ret;
24382  PyObject *name_attr;
24383  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
24384  if (likely(name_attr)) {
24385  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
24386  } else {
24387  ret = -1;
24388  }
24389  if (unlikely(ret < 0)) {
24390  PyErr_Clear();
24391  ret = 0;
24392  }
24393  Py_XDECREF(name_attr);
24394  return ret;
24395 }
24396 static int __Pyx_setup_reduce(PyObject* type_obj) {
24397  int ret = 0;
24398  PyObject *object_reduce = NULL;
24399  PyObject *object_reduce_ex = NULL;
24400  PyObject *reduce = NULL;
24401  PyObject *reduce_ex = NULL;
24402  PyObject *reduce_cython = NULL;
24403  PyObject *setstate = NULL;
24404  PyObject *setstate_cython = NULL;
24405 #if CYTHON_USE_PYTYPE_LOOKUP
24406  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
24407 #else
24408  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
24409 #endif
24410 #if CYTHON_USE_PYTYPE_LOOKUP
24411  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
24412 #else
24413  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
24414 #endif
24415  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
24416  if (reduce_ex == object_reduce_ex) {
24417 #if CYTHON_USE_PYTYPE_LOOKUP
24418  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
24419 #else
24420  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
24421 #endif
24422  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
24423  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
24424  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
24425  if (likely(reduce_cython)) {
24426  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24427  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24428  } else if (reduce == object_reduce || PyErr_Occurred()) {
24429  goto __PYX_BAD;
24430  }
24431  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
24432  if (!setstate) PyErr_Clear();
24433  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
24434  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
24435  if (likely(setstate_cython)) {
24436  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24437  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24438  } else if (!setstate || PyErr_Occurred()) {
24439  goto __PYX_BAD;
24440  }
24441  }
24442  PyType_Modified((PyTypeObject*)type_obj);
24443  }
24444  }
24445  goto __PYX_GOOD;
24446 __PYX_BAD:
24447  if (!PyErr_Occurred())
24448  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
24449  ret = -1;
24450 __PYX_GOOD:
24451 #if !CYTHON_USE_PYTYPE_LOOKUP
24452  Py_XDECREF(object_reduce);
24453  Py_XDECREF(object_reduce_ex);
24454 #endif
24455  Py_XDECREF(reduce);
24456  Py_XDECREF(reduce_ex);
24457  Py_XDECREF(reduce_cython);
24458  Py_XDECREF(setstate);
24459  Py_XDECREF(setstate_cython);
24460  return ret;
24461 }
24462 
24463 /* SetVTable */
24464 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
24465 #if PY_VERSION_HEX >= 0x02070000
24466  PyObject *ob = PyCapsule_New(vtable, 0, 0);
24467 #else
24468  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
24469 #endif
24470  if (!ob)
24471  goto bad;
24472  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
24473  goto bad;
24474  Py_DECREF(ob);
24475  return 0;
24476 bad:
24477  Py_XDECREF(ob);
24478  return -1;
24479 }
24480 
24481 /* TypeImport */
24482 #ifndef __PYX_HAVE_RT_ImportType
24483 #define __PYX_HAVE_RT_ImportType
24484 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
24485  size_t size, enum __Pyx_ImportType_CheckSize check_size)
24486 {
24487  PyObject *result = 0;
24488  char warning[200];
24489  Py_ssize_t basicsize;
24490 #ifdef Py_LIMITED_API
24491  PyObject *py_basicsize;
24492 #endif
24493  result = PyObject_GetAttrString(module, class_name);
24494  if (!result)
24495  goto bad;
24496  if (!PyType_Check(result)) {
24497  PyErr_Format(PyExc_TypeError,
24498  "%.200s.%.200s is not a type object",
24499  module_name, class_name);
24500  goto bad;
24501  }
24502 #ifndef Py_LIMITED_API
24503  basicsize = ((PyTypeObject *)result)->tp_basicsize;
24504 #else
24505  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
24506  if (!py_basicsize)
24507  goto bad;
24508  basicsize = PyLong_AsSsize_t(py_basicsize);
24509  Py_DECREF(py_basicsize);
24510  py_basicsize = 0;
24511  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
24512  goto bad;
24513 #endif
24514  if ((size_t)basicsize < size) {
24515  PyErr_Format(PyExc_ValueError,
24516  "%.200s.%.200s size changed, may indicate binary incompatibility. "
24517  "Expected %zd from C header, got %zd from PyObject",
24518  module_name, class_name, size, basicsize);
24519  goto bad;
24520  }
24521  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
24522  PyErr_Format(PyExc_ValueError,
24523  "%.200s.%.200s size changed, may indicate binary incompatibility. "
24524  "Expected %zd from C header, got %zd from PyObject",
24525  module_name, class_name, size, basicsize);
24526  goto bad;
24527  }
24528  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
24529  PyOS_snprintf(warning, sizeof(warning),
24530  "%s.%s size changed, may indicate binary incompatibility. "
24531  "Expected %zd from C header, got %zd from PyObject",
24532  module_name, class_name, size, basicsize);
24533  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
24534  }
24535  return (PyTypeObject *)result;
24536 bad:
24537  Py_XDECREF(result);
24538  return NULL;
24539 }
24540 #endif
24541 
24542 /* CalculateMetaclass */
24543 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
24544  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
24545  for (i=0; i < nbases; i++) {
24546  PyTypeObject *tmptype;
24547  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
24548  tmptype = Py_TYPE(tmp);
24549 #if PY_MAJOR_VERSION < 3
24550  if (tmptype == &PyClass_Type)
24551  continue;
24552 #endif
24553  if (!metaclass) {
24554  metaclass = tmptype;
24555  continue;
24556  }
24557  if (PyType_IsSubtype(metaclass, tmptype))
24558  continue;
24559  if (PyType_IsSubtype(tmptype, metaclass)) {
24560  metaclass = tmptype;
24561  continue;
24562  }
24563  PyErr_SetString(PyExc_TypeError,
24564  "metaclass conflict: "
24565  "the metaclass of a derived class "
24566  "must be a (non-strict) subclass "
24567  "of the metaclasses of all its bases");
24568  return NULL;
24569  }
24570  if (!metaclass) {
24571 #if PY_MAJOR_VERSION < 3
24572  metaclass = &PyClass_Type;
24573 #else
24574  metaclass = &PyType_Type;
24575 #endif
24576  }
24577  Py_INCREF((PyObject*) metaclass);
24578  return (PyObject*) metaclass;
24579 }
24580 
24581 /* FetchCommonType */
24582 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
24583  PyObject* fake_module;
24584  PyTypeObject* cached_type = NULL;
24585  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
24586  if (!fake_module) return NULL;
24587  Py_INCREF(fake_module);
24588  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
24589  if (cached_type) {
24590  if (!PyType_Check((PyObject*)cached_type)) {
24591  PyErr_Format(PyExc_TypeError,
24592  "Shared Cython type %.200s is not a type object",
24593  type->tp_name);
24594  goto bad;
24595  }
24596  if (cached_type->tp_basicsize != type->tp_basicsize) {
24597  PyErr_Format(PyExc_TypeError,
24598  "Shared Cython type %.200s has the wrong size, try recompiling",
24599  type->tp_name);
24600  goto bad;
24601  }
24602  } else {
24603  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
24604  PyErr_Clear();
24605  if (PyType_Ready(type) < 0) goto bad;
24606  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
24607  goto bad;
24608  Py_INCREF(type);
24609  cached_type = type;
24610  }
24611 done:
24612  Py_DECREF(fake_module);
24613  return cached_type;
24614 bad:
24615  Py_XDECREF(cached_type);
24616  cached_type = NULL;
24617  goto done;
24618 }
24619 
24620 /* CythonFunctionShared */
24621 #include <structmember.h>
24622 static PyObject *
24623 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
24624 {
24625  if (unlikely(op->func_doc == NULL)) {
24626  if (op->func.m_ml->ml_doc) {
24627 #if PY_MAJOR_VERSION >= 3
24628  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
24629 #else
24630  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
24631 #endif
24632  if (unlikely(op->func_doc == NULL))
24633  return NULL;
24634  } else {
24635  Py_INCREF(Py_None);
24636  return Py_None;
24637  }
24638  }
24639  Py_INCREF(op->func_doc);
24640  return op->func_doc;
24641 }
24642 static int
24643 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24644 {
24645  PyObject *tmp = op->func_doc;
24646  if (value == NULL) {
24647  value = Py_None;
24648  }
24649  Py_INCREF(value);
24650  op->func_doc = value;
24651  Py_XDECREF(tmp);
24652  return 0;
24653 }
24654 static PyObject *
24655 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24656 {
24657  if (unlikely(op->func_name == NULL)) {
24658 #if PY_MAJOR_VERSION >= 3
24659  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
24660 #else
24661  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
24662 #endif
24663  if (unlikely(op->func_name == NULL))
24664  return NULL;
24665  }
24666  Py_INCREF(op->func_name);
24667  return op->func_name;
24668 }
24669 static int
24670 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24671 {
24672  PyObject *tmp;
24673 #if PY_MAJOR_VERSION >= 3
24674  if (unlikely(value == NULL || !PyUnicode_Check(value)))
24675 #else
24676  if (unlikely(value == NULL || !PyString_Check(value)))
24677 #endif
24678  {
24679  PyErr_SetString(PyExc_TypeError,
24680  "__name__ must be set to a string object");
24681  return -1;
24682  }
24683  tmp = op->func_name;
24684  Py_INCREF(value);
24685  op->func_name = value;
24686  Py_XDECREF(tmp);
24687  return 0;
24688 }
24689 static PyObject *
24690 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24691 {
24692  Py_INCREF(op->func_qualname);
24693  return op->func_qualname;
24694 }
24695 static int
24696 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24697 {
24698  PyObject *tmp;
24699 #if PY_MAJOR_VERSION >= 3
24700  if (unlikely(value == NULL || !PyUnicode_Check(value)))
24701 #else
24702  if (unlikely(value == NULL || !PyString_Check(value)))
24703 #endif
24704  {
24705  PyErr_SetString(PyExc_TypeError,
24706  "__qualname__ must be set to a string object");
24707  return -1;
24708  }
24709  tmp = op->func_qualname;
24710  Py_INCREF(value);
24711  op->func_qualname = value;
24712  Py_XDECREF(tmp);
24713  return 0;
24714 }
24715 static PyObject *
24716 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
24717 {
24718  PyObject *self;
24719  self = m->func_closure;
24720  if (self == NULL)
24721  self = Py_None;
24722  Py_INCREF(self);
24723  return self;
24724 }
24725 static PyObject *
24726 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24727 {
24728  if (unlikely(op->func_dict == NULL)) {
24729  op->func_dict = PyDict_New();
24730  if (unlikely(op->func_dict == NULL))
24731  return NULL;
24732  }
24733  Py_INCREF(op->func_dict);
24734  return op->func_dict;
24735 }
24736 static int
24737 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24738 {
24739  PyObject *tmp;
24740  if (unlikely(value == NULL)) {
24741  PyErr_SetString(PyExc_TypeError,
24742  "function's dictionary may not be deleted");
24743  return -1;
24744  }
24745  if (unlikely(!PyDict_Check(value))) {
24746  PyErr_SetString(PyExc_TypeError,
24747  "setting function's dictionary to a non-dict");
24748  return -1;
24749  }
24750  tmp = op->func_dict;
24751  Py_INCREF(value);
24752  op->func_dict = value;
24753  Py_XDECREF(tmp);
24754  return 0;
24755 }
24756 static PyObject *
24757 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24758 {
24759  Py_INCREF(op->func_globals);
24760  return op->func_globals;
24761 }
24762 static PyObject *
24763 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24764 {
24765  Py_INCREF(Py_None);
24766  return Py_None;
24767 }
24768 static PyObject *
24769 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24770 {
24771  PyObject* result = (op->func_code) ? op->func_code : Py_None;
24772  Py_INCREF(result);
24773  return result;
24774 }
24775 static int
24776 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
24777  int result = 0;
24778  PyObject *res = op->defaults_getter((PyObject *) op);
24779  if (unlikely(!res))
24780  return -1;
24781  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24782  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
24783  Py_INCREF(op->defaults_tuple);
24784  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
24785  Py_INCREF(op->defaults_kwdict);
24786  #else
24787  op->defaults_tuple = PySequence_ITEM(res, 0);
24788  if (unlikely(!op->defaults_tuple)) result = -1;
24789  else {
24790  op->defaults_kwdict = PySequence_ITEM(res, 1);
24791  if (unlikely(!op->defaults_kwdict)) result = -1;
24792  }
24793  #endif
24794  Py_DECREF(res);
24795  return result;
24796 }
24797 static int
24798 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
24799  PyObject* tmp;
24800  if (!value) {
24801  value = Py_None;
24802  } else if (value != Py_None && !PyTuple_Check(value)) {
24803  PyErr_SetString(PyExc_TypeError,
24804  "__defaults__ must be set to a tuple object");
24805  return -1;
24806  }
24807  Py_INCREF(value);
24808  tmp = op->defaults_tuple;
24809  op->defaults_tuple = value;
24810  Py_XDECREF(tmp);
24811  return 0;
24812 }
24813 static PyObject *
24814 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
24815  PyObject* result = op->defaults_tuple;
24816  if (unlikely(!result)) {
24817  if (op->defaults_getter) {
24818  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
24819  result = op->defaults_tuple;
24820  } else {
24821  result = Py_None;
24822  }
24823  }
24824  Py_INCREF(result);
24825  return result;
24826 }
24827 static int
24828 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
24829  PyObject* tmp;
24830  if (!value) {
24831  value = Py_None;
24832  } else if (value != Py_None && !PyDict_Check(value)) {
24833  PyErr_SetString(PyExc_TypeError,
24834  "__kwdefaults__ must be set to a dict object");
24835  return -1;
24836  }
24837  Py_INCREF(value);
24838  tmp = op->defaults_kwdict;
24839  op->defaults_kwdict = value;
24840  Py_XDECREF(tmp);
24841  return 0;
24842 }
24843 static PyObject *
24844 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
24845  PyObject* result = op->defaults_kwdict;
24846  if (unlikely(!result)) {
24847  if (op->defaults_getter) {
24848  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
24849  result = op->defaults_kwdict;
24850  } else {
24851  result = Py_None;
24852  }
24853  }
24854  Py_INCREF(result);
24855  return result;
24856 }
24857 static int
24858 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
24859  PyObject* tmp;
24860  if (!value || value == Py_None) {
24861  value = NULL;
24862  } else if (!PyDict_Check(value)) {
24863  PyErr_SetString(PyExc_TypeError,
24864  "__annotations__ must be set to a dict object");
24865  return -1;
24866  }
24867  Py_XINCREF(value);
24868  tmp = op->func_annotations;
24869  op->func_annotations = value;
24870  Py_XDECREF(tmp);
24871  return 0;
24872 }
24873 static PyObject *
24874 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
24875  PyObject* result = op->func_annotations;
24876  if (unlikely(!result)) {
24877  result = PyDict_New();
24878  if (unlikely(!result)) return NULL;
24879  op->func_annotations = result;
24880  }
24881  Py_INCREF(result);
24882  return result;
24883 }
24884 static PyGetSetDef __pyx_CyFunction_getsets[] = {
24885  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
24886  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
24887  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
24888  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
24889  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
24890  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
24891  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
24892  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
24893  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
24894  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
24895  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
24896  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
24897  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
24898  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
24899  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
24900  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
24901  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
24902  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
24903  {0, 0, 0, 0, 0}
24904 };
24905 static PyMemberDef __pyx_CyFunction_members[] = {
24906  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
24907  {0, 0, 0, 0, 0}
24908 };
24909 static PyObject *
24910 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
24911 {
24912 #if PY_MAJOR_VERSION >= 3
24913  Py_INCREF(m->func_qualname);
24914  return m->func_qualname;
24915 #else
24916  return PyString_FromString(m->func.m_ml->ml_name);
24917 #endif
24918 }
24919 static PyMethodDef __pyx_CyFunction_methods[] = {
24920  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
24921  {0, 0, 0, 0}
24922 };
24923 #if PY_VERSION_HEX < 0x030500A0
24924 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
24925 #else
24926 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
24927 #endif
24928 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
24929  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
24930  if (unlikely(op == NULL))
24931  return NULL;
24932  op->flags = flags;
24933  __Pyx_CyFunction_weakreflist(op) = NULL;
24934  op->func.m_ml = ml;
24935  op->func.m_self = (PyObject *) op;
24936  Py_XINCREF(closure);
24937  op->func_closure = closure;
24938  Py_XINCREF(module);
24939  op->func.m_module = module;
24940  op->func_dict = NULL;
24941  op->func_name = NULL;
24942  Py_INCREF(qualname);
24943  op->func_qualname = qualname;
24944  op->func_doc = NULL;
24945  op->func_classobj = NULL;
24946  op->func_globals = globals;
24947  Py_INCREF(op->func_globals);
24948  Py_XINCREF(code);
24949  op->func_code = code;
24950  op->defaults_pyobjects = 0;
24951  op->defaults_size = 0;
24952  op->defaults = NULL;
24953  op->defaults_tuple = NULL;
24954  op->defaults_kwdict = NULL;
24955  op->defaults_getter = NULL;
24956  op->func_annotations = NULL;
24957  return (PyObject *) op;
24958 }
24959 static int
24960 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
24961 {
24962  Py_CLEAR(m->func_closure);
24963  Py_CLEAR(m->func.m_module);
24964  Py_CLEAR(m->func_dict);
24965  Py_CLEAR(m->func_name);
24966  Py_CLEAR(m->func_qualname);
24967  Py_CLEAR(m->func_doc);
24968  Py_CLEAR(m->func_globals);
24969  Py_CLEAR(m->func_code);
24970  Py_CLEAR(m->func_classobj);
24971  Py_CLEAR(m->defaults_tuple);
24972  Py_CLEAR(m->defaults_kwdict);
24973  Py_CLEAR(m->func_annotations);
24974  if (m->defaults) {
24975  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
24976  int i;
24977  for (i = 0; i < m->defaults_pyobjects; i++)
24978  Py_XDECREF(pydefaults[i]);
24979  PyObject_Free(m->defaults);
24980  m->defaults = NULL;
24981  }
24982  return 0;
24983 }
24984 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
24985 {
24986  if (__Pyx_CyFunction_weakreflist(m) != NULL)
24987  PyObject_ClearWeakRefs((PyObject *) m);
24988  __Pyx_CyFunction_clear(m);
24989  PyObject_GC_Del(m);
24990 }
24991 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
24992 {
24993  PyObject_GC_UnTrack(m);
24994  __Pyx__CyFunction_dealloc(m);
24995 }
24996 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
24997 {
24998  Py_VISIT(m->func_closure);
24999  Py_VISIT(m->func.m_module);
25000  Py_VISIT(m->func_dict);
25001  Py_VISIT(m->func_name);
25002  Py_VISIT(m->func_qualname);
25003  Py_VISIT(m->func_doc);
25004  Py_VISIT(m->func_globals);
25005  Py_VISIT(m->func_code);
25006  Py_VISIT(m->func_classobj);
25007  Py_VISIT(m->defaults_tuple);
25008  Py_VISIT(m->defaults_kwdict);
25009  if (m->defaults) {
25010  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25011  int i;
25012  for (i = 0; i < m->defaults_pyobjects; i++)
25013  Py_VISIT(pydefaults[i]);
25014  }
25015  return 0;
25016 }
25017 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25018 {
25019 #if PY_MAJOR_VERSION < 3
25020  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25021  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25022  Py_INCREF(func);
25023  return func;
25024  }
25025  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25026  if (type == NULL)
25027  type = (PyObject *)(Py_TYPE(obj));
25028  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25029  }
25030  if (obj == Py_None)
25031  obj = NULL;
25032 #endif
25033  return __Pyx_PyMethod_New(func, obj, type);
25034 }
25035 static PyObject*
25036 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25037 {
25038 #if PY_MAJOR_VERSION >= 3
25039  return PyUnicode_FromFormat("<cyfunction %U at %p>",
25040  op->func_qualname, (void *)op);
25041 #else
25042  return PyString_FromFormat("<cyfunction %s at %p>",
25043  PyString_AsString(op->func_qualname), (void *)op);
25044 #endif
25045 }
25046 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
25047  PyCFunctionObject* f = (PyCFunctionObject*)func;
25048  PyCFunction meth = f->m_ml->ml_meth;
25049  Py_ssize_t size;
25050  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25051  case METH_VARARGS:
25052  if (likely(kw == NULL || PyDict_Size(kw) == 0))
25053  return (*meth)(self, arg);
25054  break;
25055  case METH_VARARGS | METH_KEYWORDS:
25056  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
25057  case METH_NOARGS:
25058  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25059  size = PyTuple_GET_SIZE(arg);
25060  if (likely(size == 0))
25061  return (*meth)(self, NULL);
25062  PyErr_Format(PyExc_TypeError,
25063  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
25064  f->m_ml->ml_name, size);
25065  return NULL;
25066  }
25067  break;
25068  case METH_O:
25069  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25070  size = PyTuple_GET_SIZE(arg);
25071  if (likely(size == 1)) {
25072  PyObject *result, *arg0;
25073  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25074  arg0 = PyTuple_GET_ITEM(arg, 0);
25075  #else
25076  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
25077  #endif
25078  result = (*meth)(self, arg0);
25079  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25080  Py_DECREF(arg0);
25081  #endif
25082  return result;
25083  }
25084  PyErr_Format(PyExc_TypeError,
25085  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
25086  f->m_ml->ml_name, size);
25087  return NULL;
25088  }
25089  break;
25090  default:
25091  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
25092  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25093  "longer supported!");
25094  return NULL;
25095  }
25096  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
25097  f->m_ml->ml_name);
25098  return NULL;
25099 }
25100 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25101  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25102 }
25103 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25104  PyObject *result;
25105  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25106  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25107  Py_ssize_t argc;
25108  PyObject *new_args;
25109  PyObject *self;
25110  argc = PyTuple_GET_SIZE(args);
25111  new_args = PyTuple_GetSlice(args, 1, argc);
25112  if (unlikely(!new_args))
25113  return NULL;
25114  self = PyTuple_GetItem(args, 0);
25115  if (unlikely(!self)) {
25116  Py_DECREF(new_args);
25117  return NULL;
25118  }
25119  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
25120  Py_DECREF(new_args);
25121  } else {
25122  result = __Pyx_CyFunction_Call(func, args, kw);
25123  }
25124  return result;
25125 }
25126 static PyTypeObject __pyx_CyFunctionType_type = {
25127  PyVarObject_HEAD_INIT(0, 0)
25128  "cython_function_or_method",
25129  sizeof(__pyx_CyFunctionObject),
25130  0,
25131  (destructor) __Pyx_CyFunction_dealloc,
25132  0,
25133  0,
25134  0,
25135 #if PY_MAJOR_VERSION < 3
25136  0,
25137 #else
25138  0,
25139 #endif
25140  (reprfunc) __Pyx_CyFunction_repr,
25141  0,
25142  0,
25143  0,
25144  0,
25145  __Pyx_CyFunction_CallAsMethod,
25146  0,
25147  0,
25148  0,
25149  0,
25150  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25151  0,
25152  (traverseproc) __Pyx_CyFunction_traverse,
25153  (inquiry) __Pyx_CyFunction_clear,
25154  0,
25155 #if PY_VERSION_HEX < 0x030500A0
25156  offsetof(__pyx_CyFunctionObject, func_weakreflist),
25157 #else
25158  offsetof(PyCFunctionObject, m_weakreflist),
25159 #endif
25160  0,
25161  0,
25162  __pyx_CyFunction_methods,
25163  __pyx_CyFunction_members,
25164  __pyx_CyFunction_getsets,
25165  0,
25166  0,
25167  __Pyx_CyFunction_descr_get,
25168  0,
25169  offsetof(__pyx_CyFunctionObject, func_dict),
25170  0,
25171  0,
25172  0,
25173  0,
25174  0,
25175  0,
25176  0,
25177  0,
25178  0,
25179  0,
25180  0,
25181  0,
25182 #if PY_VERSION_HEX >= 0x030400a1
25183  0,
25184 #endif
25185 #if PY_VERSION_HEX >= 0x030800b1
25186  0,
25187 #endif
25188 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25189  0,
25190 #endif
25191 };
25192 static int __pyx_CyFunction_init(void) {
25193  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25194  if (unlikely(__pyx_CyFunctionType == NULL)) {
25195  return -1;
25196  }
25197  return 0;
25198 }
25199 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
25200  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25201  m->defaults = PyObject_Malloc(size);
25202  if (unlikely(!m->defaults))
25203  return PyErr_NoMemory();
25204  memset(m->defaults, 0, size);
25205  m->defaults_pyobjects = pyobjects;
25206  m->defaults_size = size;
25207  return m->defaults;
25208 }
25209 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25210  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25211  m->defaults_tuple = tuple;
25212  Py_INCREF(tuple);
25213 }
25214 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25215  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25216  m->defaults_kwdict = dict;
25217  Py_INCREF(dict);
25218 }
25219 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25220  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25221  m->func_annotations = dict;
25222  Py_INCREF(dict);
25223 }
25224 
25225 /* CythonFunction */
25226 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
25227  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25228  PyObject *op = __Pyx_CyFunction_Init(
25229  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
25230  ml, flags, qualname, closure, module, globals, code
25231  );
25232  if (likely(op)) {
25233  PyObject_GC_Track(op);
25234  }
25235  return op;
25236 }
25237 
25238 /* Py3ClassCreate */
25239 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
25240  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
25241  PyObject *ns;
25242  if (metaclass) {
25243  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
25244  if (prep) {
25245  PyObject *pargs = PyTuple_Pack(2, name, bases);
25246  if (unlikely(!pargs)) {
25247  Py_DECREF(prep);
25248  return NULL;
25249  }
25250  ns = PyObject_Call(prep, pargs, mkw);
25251  Py_DECREF(prep);
25252  Py_DECREF(pargs);
25253  } else {
25254  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
25255  return NULL;
25256  PyErr_Clear();
25257  ns = PyDict_New();
25258  }
25259  } else {
25260  ns = PyDict_New();
25261  }
25262  if (unlikely(!ns))
25263  return NULL;
25264  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
25265  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
25266  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
25267  return ns;
25268 bad:
25269  Py_DECREF(ns);
25270  return NULL;
25271 }
25272 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
25273  PyObject *dict, PyObject *mkw,
25274  int calculate_metaclass, int allow_py2_metaclass) {
25275  PyObject *result, *margs;
25276  PyObject *owned_metaclass = NULL;
25277  if (allow_py2_metaclass) {
25278  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
25279  if (owned_metaclass) {
25280  metaclass = owned_metaclass;
25281  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
25282  PyErr_Clear();
25283  } else {
25284  return NULL;
25285  }
25286  }
25287  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
25288  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
25289  Py_XDECREF(owned_metaclass);
25290  if (unlikely(!metaclass))
25291  return NULL;
25292  owned_metaclass = metaclass;
25293  }
25294  margs = PyTuple_Pack(3, name, bases, dict);
25295  if (unlikely(!margs)) {
25296  result = NULL;
25297  } else {
25298  result = PyObject_Call(metaclass, margs, mkw);
25299  Py_DECREF(margs);
25300  }
25301  Py_XDECREF(owned_metaclass);
25302  return result;
25303 }
25304 
25305 /* CLineInTraceback */
25306 #ifndef CYTHON_CLINE_IN_TRACEBACK
25307 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
25308  PyObject *use_cline;
25309  PyObject *ptype, *pvalue, *ptraceback;
25310 #if CYTHON_COMPILING_IN_CPYTHON
25311  PyObject **cython_runtime_dict;
25312 #endif
25313  if (unlikely(!__pyx_cython_runtime)) {
25314  return c_line;
25315  }
25316  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25317 #if CYTHON_COMPILING_IN_CPYTHON
25318  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25319  if (likely(cython_runtime_dict)) {
25320  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25321  use_cline, *cython_runtime_dict,
25322  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25323  } else
25324 #endif
25325  {
25326  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25327  if (use_cline_obj) {
25328  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25329  Py_DECREF(use_cline_obj);
25330  } else {
25331  PyErr_Clear();
25332  use_cline = NULL;
25333  }
25334  }
25335  if (!use_cline) {
25336  c_line = 0;
25337  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25338  }
25339  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25340  c_line = 0;
25341  }
25342  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25343  return c_line;
25344 }
25345 #endif
25346 
25347 /* CodeObjectCache */
25348 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
25349  int start = 0, mid = 0, end = count - 1;
25350  if (end >= 0 && code_line > entries[end].code_line) {
25351  return count;
25352  }
25353  while (start < end) {
25354  mid = start + (end - start) / 2;
25355  if (code_line < entries[mid].code_line) {
25356  end = mid;
25357  } else if (code_line > entries[mid].code_line) {
25358  start = mid + 1;
25359  } else {
25360  return mid;
25361  }
25362  }
25363  if (code_line <= entries[mid].code_line) {
25364  return mid;
25365  } else {
25366  return mid + 1;
25367  }
25368 }
25369 static PyCodeObject *__pyx_find_code_object(int code_line) {
25370  PyCodeObject* code_object;
25371  int pos;
25372  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25373  return NULL;
25374  }
25375  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25376  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25377  return NULL;
25378  }
25379  code_object = __pyx_code_cache.entries[pos].code_object;
25380  Py_INCREF(code_object);
25381  return code_object;
25382 }
25383 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
25384  int pos, i;
25385  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25386  if (unlikely(!code_line)) {
25387  return;
25388  }
25389  if (unlikely(!entries)) {
25390  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
25391  if (likely(entries)) {
25392  __pyx_code_cache.entries = entries;
25393  __pyx_code_cache.max_count = 64;
25394  __pyx_code_cache.count = 1;
25395  entries[0].code_line = code_line;
25396  entries[0].code_object = code_object;
25397  Py_INCREF(code_object);
25398  }
25399  return;
25400  }
25401  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25402  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
25403  PyCodeObject* tmp = entries[pos].code_object;
25404  entries[pos].code_object = code_object;
25405  Py_DECREF(tmp);
25406  return;
25407  }
25408  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25409  int new_max = __pyx_code_cache.max_count + 64;
25410  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25411  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
25412  if (unlikely(!entries)) {
25413  return;
25414  }
25415  __pyx_code_cache.entries = entries;
25416  __pyx_code_cache.max_count = new_max;
25417  }
25418  for (i=__pyx_code_cache.count; i>pos; i--) {
25419  entries[i] = entries[i-1];
25420  }
25421  entries[pos].code_line = code_line;
25422  entries[pos].code_object = code_object;
25423  __pyx_code_cache.count++;
25424  Py_INCREF(code_object);
25425 }
25426 
25427 /* AddTraceback */
25428 #include "compile.h"
25429 #include "frameobject.h"
25430 #include "traceback.h"
25431 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25432  const char *funcname, int c_line,
25433  int py_line, const char *filename) {
25434  PyCodeObject *py_code = 0;
25435  PyObject *py_srcfile = 0;
25436  PyObject *py_funcname = 0;
25437  #if PY_MAJOR_VERSION < 3
25438  py_srcfile = PyString_FromString(filename);
25439  #else
25440  py_srcfile = PyUnicode_FromString(filename);
25441  #endif
25442  if (!py_srcfile) goto bad;
25443  if (c_line) {
25444  #if PY_MAJOR_VERSION < 3
25445  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25446  #else
25447  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25448  #endif
25449  }
25450  else {
25451  #if PY_MAJOR_VERSION < 3
25452  py_funcname = PyString_FromString(funcname);
25453  #else
25454  py_funcname = PyUnicode_FromString(funcname);
25455  #endif
25456  }
25457  if (!py_funcname) goto bad;
25458  py_code = __Pyx_PyCode_New(
25459  0,
25460  0,
25461  0,
25462  0,
25463  0,
25464  __pyx_empty_bytes, /*PyObject *code,*/
25465  __pyx_empty_tuple, /*PyObject *consts,*/
25466  __pyx_empty_tuple, /*PyObject *names,*/
25467  __pyx_empty_tuple, /*PyObject *varnames,*/
25468  __pyx_empty_tuple, /*PyObject *freevars,*/
25469  __pyx_empty_tuple, /*PyObject *cellvars,*/
25470  py_srcfile, /*PyObject *filename,*/
25471  py_funcname, /*PyObject *name,*/
25472  py_line,
25473  __pyx_empty_bytes /*PyObject *lnotab*/
25474  );
25475  Py_DECREF(py_srcfile);
25476  Py_DECREF(py_funcname);
25477  return py_code;
25478 bad:
25479  Py_XDECREF(py_srcfile);
25480  Py_XDECREF(py_funcname);
25481  return NULL;
25482 }
25483 static void __Pyx_AddTraceback(const char *funcname, int c_line,
25484  int py_line, const char *filename) {
25485  PyCodeObject *py_code = 0;
25486  PyFrameObject *py_frame = 0;
25487  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25488  if (c_line) {
25489  c_line = __Pyx_CLineForTraceback(tstate, c_line);
25490  }
25491  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25492  if (!py_code) {
25493  py_code = __Pyx_CreateCodeObjectForTraceback(
25494  funcname, c_line, py_line, filename);
25495  if (!py_code) goto bad;
25496  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25497  }
25498  py_frame = PyFrame_New(
25499  tstate, /*PyThreadState *tstate,*/
25500  py_code, /*PyCodeObject *code,*/
25501  __pyx_d, /*PyObject *globals,*/
25502  0 /*PyObject *locals*/
25503  );
25504  if (!py_frame) goto bad;
25505  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25506  PyTraceBack_Here(py_frame);
25507 bad:
25508  Py_XDECREF(py_code);
25509  Py_XDECREF(py_frame);
25510 }
25511 
25512 #if PY_MAJOR_VERSION < 3
25513 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
25514  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
25515  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
25516  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
25517  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
25518  return -1;
25519 }
25520 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
25521  PyObject *obj = view->obj;
25522  if (!obj) return;
25523  if (PyObject_CheckBuffer(obj)) {
25524  PyBuffer_Release(view);
25525  return;
25526  }
25527  if ((0)) {}
25528  view->obj = NULL;
25529  Py_DECREF(obj);
25530 }
25531 #endif
25532 
25533 
25534 /* MemviewSliceIsContig */
25535 static int
25536 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
25537 {
25538  int i, index, step, start;
25539  Py_ssize_t itemsize = mvs.memview->view.itemsize;
25540  if (order == 'F') {
25541  step = 1;
25542  start = 0;
25543  } else {
25544  step = -1;
25545  start = ndim - 1;
25546  }
25547  for (i = 0; i < ndim; i++) {
25548  index = start + step * i;
25549  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
25550  return 0;
25551  itemsize *= mvs.shape[index];
25552  }
25553  return 1;
25554 }
25555 
25556 /* OverlappingSlices */
25557 static void
25558 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
25559  void **out_start, void **out_end,
25560  int ndim, size_t itemsize)
25561 {
25562  char *start, *end;
25563  int i;
25564  start = end = slice->data;
25565  for (i = 0; i < ndim; i++) {
25566  Py_ssize_t stride = slice->strides[i];
25567  Py_ssize_t extent = slice->shape[i];
25568  if (extent == 0) {
25569  *out_start = *out_end = start;
25570  return;
25571  } else {
25572  if (stride > 0)
25573  end += stride * (extent - 1);
25574  else
25575  start += stride * (extent - 1);
25576  }
25577  }
25578  *out_start = start;
25579  *out_end = end + itemsize;
25580 }
25581 static int
25582 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
25583  __Pyx_memviewslice *slice2,
25584  int ndim, size_t itemsize)
25585 {
25586  void *start1, *end1, *start2, *end2;
25587  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
25588  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
25589  return (start1 < end2) && (start2 < end1);
25590 }
25591 
25592 /* Capsule */
25593 static CYTHON_INLINE PyObject *
25594 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
25595 {
25596  PyObject *cobj;
25597 #if PY_VERSION_HEX >= 0x02070000
25598  cobj = PyCapsule_New(p, sig, NULL);
25599 #else
25600  cobj = PyCObject_FromVoidPtr(p, NULL);
25601 #endif
25602  return cobj;
25603 }
25604 
25605 /* CIntFromPyVerify */
25606 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
25607  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
25608 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
25609  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
25610 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
25611  {\
25612  func_type value = func_value;\
25613  if (sizeof(target_type) < sizeof(func_type)) {\
25614  if (unlikely(value != (func_type) (target_type) value)) {\
25615  func_type zero = 0;\
25616  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
25617  return (target_type) -1;\
25618  if (is_unsigned && unlikely(value < zero))\
25619  goto raise_neg_overflow;\
25620  else\
25621  goto raise_overflow;\
25622  }\
25623  }\
25624  return (target_type) value;\
25625  }
25626 
25627 /* IsLittleEndian */
25628 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
25629 {
25630  union {
25631  uint32_t u32;
25632  uint8_t u8[4];
25633  } S;
25634  S.u32 = 0x01020304;
25635  return S.u8[0] == 4;
25636 }
25637 
25638 /* BufferFormatCheck */
25639 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
25640  __Pyx_BufFmt_StackElem* stack,
25641  __Pyx_TypeInfo* type) {
25642  stack[0].field = &ctx->root;
25643  stack[0].parent_offset = 0;
25644  ctx->root.type = type;
25645  ctx->root.name = "buffer dtype";
25646  ctx->root.offset = 0;
25647  ctx->head = stack;
25648  ctx->head->field = &ctx->root;
25649  ctx->fmt_offset = 0;
25650  ctx->head->parent_offset = 0;
25651  ctx->new_packmode = '@';
25652  ctx->enc_packmode = '@';
25653  ctx->new_count = 1;
25654  ctx->enc_count = 0;
25655  ctx->enc_type = 0;
25656  ctx->is_complex = 0;
25657  ctx->is_valid_array = 0;
25658  ctx->struct_alignment = 0;
25659  while (type->typegroup == 'S') {
25660  ++ctx->head;
25661  ctx->head->field = type->fields;
25662  ctx->head->parent_offset = 0;
25663  type = type->fields->type;
25664  }
25665 }
25666 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
25667  int count;
25668  const char* t = *ts;
25669  if (*t < '0' || *t > '9') {
25670  return -1;
25671  } else {
25672  count = *t++ - '0';
25673  while (*t >= '0' && *t <= '9') {
25674  count *= 10;
25675  count += *t++ - '0';
25676  }
25677  }
25678  *ts = t;
25679  return count;
25680 }
25681 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
25682  int number = __Pyx_BufFmt_ParseNumber(ts);
25683  if (number == -1)
25684  PyErr_Format(PyExc_ValueError,\
25685  "Does not understand character buffer dtype format string ('%c')", **ts);
25686  return number;
25687 }
25688 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
25689  PyErr_Format(PyExc_ValueError,
25690  "Unexpected format string character: '%c'", ch);
25691 }
25692 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
25693  switch (ch) {
25694  case '?': return "'bool'";
25695  case 'c': return "'char'";
25696  case 'b': return "'signed char'";
25697  case 'B': return "'unsigned char'";
25698  case 'h': return "'short'";
25699  case 'H': return "'unsigned short'";
25700  case 'i': return "'int'";
25701  case 'I': return "'unsigned int'";
25702  case 'l': return "'long'";
25703  case 'L': return "'unsigned long'";
25704  case 'q': return "'long long'";
25705  case 'Q': return "'unsigned long long'";
25706  case 'f': return (is_complex ? "'complex float'" : "'float'");
25707  case 'd': return (is_complex ? "'complex double'" : "'double'");
25708  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
25709  case 'T': return "a struct";
25710  case 'O': return "Python object";
25711  case 'P': return "a pointer";
25712  case 's': case 'p': return "a string";
25713  case 0: return "end";
25714  default: return "unparseable format string";
25715  }
25716 }
25717 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
25718  switch (ch) {
25719  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25720  case 'h': case 'H': return 2;
25721  case 'i': case 'I': case 'l': case 'L': return 4;
25722  case 'q': case 'Q': return 8;
25723  case 'f': return (is_complex ? 8 : 4);
25724  case 'd': return (is_complex ? 16 : 8);
25725  case 'g': {
25726  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
25727  return 0;
25728  }
25729  case 'O': case 'P': return sizeof(void*);
25730  default:
25731  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25732  return 0;
25733  }
25734 }
25735 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
25736  switch (ch) {
25737  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25738  case 'h': case 'H': return sizeof(short);
25739  case 'i': case 'I': return sizeof(int);
25740  case 'l': case 'L': return sizeof(long);
25741  #ifdef HAVE_LONG_LONG
25742  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
25743  #endif
25744  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
25745  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
25746  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
25747  case 'O': case 'P': return sizeof(void*);
25748  default: {
25749  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25750  return 0;
25751  }
25752  }
25753 }
25754 typedef struct { char c; short x; } __Pyx_st_short;
25755 typedef struct { char c; int x; } __Pyx_st_int;
25756 typedef struct { char c; long x; } __Pyx_st_long;
25757 typedef struct { char c; float x; } __Pyx_st_float;
25758 typedef struct { char c; double x; } __Pyx_st_double;
25759 typedef struct { char c; long double x; } __Pyx_st_longdouble;
25760 typedef struct { char c; void *x; } __Pyx_st_void_p;
25761 #ifdef HAVE_LONG_LONG
25762 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
25763 #endif
25764 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
25765  switch (ch) {
25766  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25767  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
25768  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
25769  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
25770 #ifdef HAVE_LONG_LONG
25771  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
25772 #endif
25773  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
25774  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
25775  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
25776  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
25777  default:
25778  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25779  return 0;
25780  }
25781 }
25782 /* These are for computing the padding at the end of the struct to align
25783  on the first member of the struct. This will probably the same as above,
25784  but we don't have any guarantees.
25785  */
25786 typedef struct { short x; char c; } __Pyx_pad_short;
25787 typedef struct { int x; char c; } __Pyx_pad_int;
25788 typedef struct { long x; char c; } __Pyx_pad_long;
25789 typedef struct { float x; char c; } __Pyx_pad_float;
25790 typedef struct { double x; char c; } __Pyx_pad_double;
25791 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
25792 typedef struct { void *x; char c; } __Pyx_pad_void_p;
25793 #ifdef HAVE_LONG_LONG
25794 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
25795 #endif
25796 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
25797  switch (ch) {
25798  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25799  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
25800  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
25801  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
25802 #ifdef HAVE_LONG_LONG
25803  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
25804 #endif
25805  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
25806  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
25807  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
25808  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
25809  default:
25810  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25811  return 0;
25812  }
25813 }
25814 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
25815  switch (ch) {
25816  case 'c':
25817  return 'H';
25818  case 'b': case 'h': case 'i':
25819  case 'l': case 'q': case 's': case 'p':
25820  return 'I';
25821  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
25822  return 'U';
25823  case 'f': case 'd': case 'g':
25824  return (is_complex ? 'C' : 'R');
25825  case 'O':
25826  return 'O';
25827  case 'P':
25828  return 'P';
25829  default: {
25830  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25831  return 0;
25832  }
25833  }
25834 }
25835 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
25836  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
25837  const char* expected;
25838  const char* quote;
25839  if (ctx->head == NULL) {
25840  expected = "end";
25841  quote = "";
25842  } else {
25843  expected = ctx->head->field->type->name;
25844  quote = "'";
25845  }
25846  PyErr_Format(PyExc_ValueError,
25847  "Buffer dtype mismatch, expected %s%s%s but got %s",
25848  quote, expected, quote,
25849  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
25850  } else {
25851  __Pyx_StructField* field = ctx->head->field;
25852  __Pyx_StructField* parent = (ctx->head - 1)->field;
25853  PyErr_Format(PyExc_ValueError,
25854  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
25855  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
25856  parent->type->name, field->name);
25857  }
25858 }
25859 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
25860  char group;
25861  size_t size, offset, arraysize = 1;
25862  if (ctx->enc_type == 0) return 0;
25863  if (ctx->head->field->type->arraysize[0]) {
25864  int i, ndim = 0;
25865  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
25866  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
25867  ndim = 1;
25868  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
25869  PyErr_Format(PyExc_ValueError,
25870  "Expected a dimension of size %zu, got %zu",
25871  ctx->head->field->type->arraysize[0], ctx->enc_count);
25872  return -1;
25873  }
25874  }
25875  if (!ctx->is_valid_array) {
25876  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
25877  ctx->head->field->type->ndim, ndim);
25878  return -1;
25879  }
25880  for (i = 0; i < ctx->head->field->type->ndim; i++) {
25881  arraysize *= ctx->head->field->type->arraysize[i];
25882  }
25883  ctx->is_valid_array = 0;
25884  ctx->enc_count = 1;
25885  }
25886  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
25887  do {
25888  __Pyx_StructField* field = ctx->head->field;
25889  __Pyx_TypeInfo* type = field->type;
25890  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
25891  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
25892  } else {
25893  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
25894  }
25895  if (ctx->enc_packmode == '@') {
25896  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
25897  size_t align_mod_offset;
25898  if (align_at == 0) return -1;
25899  align_mod_offset = ctx->fmt_offset % align_at;
25900  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
25901  if (ctx->struct_alignment == 0)
25902  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
25903  ctx->is_complex);
25904  }
25905  if (type->size != size || type->typegroup != group) {
25906  if (type->typegroup == 'C' && type->fields != NULL) {
25907  size_t parent_offset = ctx->head->parent_offset + field->offset;
25908  ++ctx->head;
25909  ctx->head->field = type->fields;
25910  ctx->head->parent_offset = parent_offset;
25911  continue;
25912  }
25913  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
25914  } else {
25915  __Pyx_BufFmt_RaiseExpected(ctx);
25916  return -1;
25917  }
25918  }
25919  offset = ctx->head->parent_offset + field->offset;
25920  if (ctx->fmt_offset != offset) {
25921  PyErr_Format(PyExc_ValueError,
25922  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
25923  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
25924  return -1;
25925  }
25926  ctx->fmt_offset += size;
25927  if (arraysize)
25928  ctx->fmt_offset += (arraysize - 1) * size;
25929  --ctx->enc_count;
25930  while (1) {
25931  if (field == &ctx->root) {
25932  ctx->head = NULL;
25933  if (ctx->enc_count != 0) {
25934  __Pyx_BufFmt_RaiseExpected(ctx);
25935  return -1;
25936  }
25937  break;
25938  }
25939  ctx->head->field = ++field;
25940  if (field->type == NULL) {
25941  --ctx->head;
25942  field = ctx->head->field;
25943  continue;
25944  } else if (field->type->typegroup == 'S') {
25945  size_t parent_offset = ctx->head->parent_offset + field->offset;
25946  if (field->type->fields->type == NULL) continue;
25947  field = field->type->fields;
25948  ++ctx->head;
25949  ctx->head->field = field;
25950  ctx->head->parent_offset = parent_offset;
25951  break;
25952  } else {
25953  break;
25954  }
25955  }
25956  } while (ctx->enc_count);
25957  ctx->enc_type = 0;
25958  ctx->is_complex = 0;
25959  return 0;
25960 }
25961 static PyObject *
25962 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
25963 {
25964  const char *ts = *tsp;
25965  int i = 0, number, ndim;
25966  ++ts;
25967  if (ctx->new_count != 1) {
25968  PyErr_SetString(PyExc_ValueError,
25969  "Cannot handle repeated arrays in format string");
25970  return NULL;
25971  }
25972  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
25973  ndim = ctx->head->field->type->ndim;
25974  while (*ts && *ts != ')') {
25975  switch (*ts) {
25976  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
25977  default: break;
25978  }
25979  number = __Pyx_BufFmt_ExpectNumber(&ts);
25980  if (number == -1) return NULL;
25981  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
25982  return PyErr_Format(PyExc_ValueError,
25983  "Expected a dimension of size %zu, got %d",
25984  ctx->head->field->type->arraysize[i], number);
25985  if (*ts != ',' && *ts != ')')
25986  return PyErr_Format(PyExc_ValueError,
25987  "Expected a comma in format string, got '%c'", *ts);
25988  if (*ts == ',') ts++;
25989  i++;
25990  }
25991  if (i != ndim)
25992  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
25993  ctx->head->field->type->ndim, i);
25994  if (!*ts) {
25995  PyErr_SetString(PyExc_ValueError,
25996  "Unexpected end of format string, expected ')'");
25997  return NULL;
25998  }
25999  ctx->is_valid_array = 1;
26000  ctx->new_count = 1;
26001  *tsp = ++ts;
26002  return Py_None;
26003 }
26004 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
26005  int got_Z = 0;
26006  while (1) {
26007  switch(*ts) {
26008  case 0:
26009  if (ctx->enc_type != 0 && ctx->head == NULL) {
26010  __Pyx_BufFmt_RaiseExpected(ctx);
26011  return NULL;
26012  }
26013  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26014  if (ctx->head != NULL) {
26015  __Pyx_BufFmt_RaiseExpected(ctx);
26016  return NULL;
26017  }
26018  return ts;
26019  case ' ':
26020  case '\r':
26021  case '\n':
26022  ++ts;
26023  break;
26024  case '<':
26025  if (!__Pyx_Is_Little_Endian()) {
26026  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
26027  return NULL;
26028  }
26029  ctx->new_packmode = '=';
26030  ++ts;
26031  break;
26032  case '>':
26033  case '!':
26034  if (__Pyx_Is_Little_Endian()) {
26035  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
26036  return NULL;
26037  }
26038  ctx->new_packmode = '=';
26039  ++ts;
26040  break;
26041  case '=':
26042  case '@':
26043  case '^':
26044  ctx->new_packmode = *ts++;
26045  break;
26046  case 'T':
26047  {
26048  const char* ts_after_sub;
26049  size_t i, struct_count = ctx->new_count;
26050  size_t struct_alignment = ctx->struct_alignment;
26051  ctx->new_count = 1;
26052  ++ts;
26053  if (*ts != '{') {
26054  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
26055  return NULL;
26056  }
26057  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26058  ctx->enc_type = 0;
26059  ctx->enc_count = 0;
26060  ctx->struct_alignment = 0;
26061  ++ts;
26062  ts_after_sub = ts;
26063  for (i = 0; i != struct_count; ++i) {
26064  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
26065  if (!ts_after_sub) return NULL;
26066  }
26067  ts = ts_after_sub;
26068  if (struct_alignment) ctx->struct_alignment = struct_alignment;
26069  }
26070  break;
26071  case '}':
26072  {
26073  size_t alignment = ctx->struct_alignment;
26074  ++ts;
26075  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26076  ctx->enc_type = 0;
26077  if (alignment && ctx->fmt_offset % alignment) {
26078  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
26079  }
26080  }
26081  return ts;
26082  case 'x':
26083  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26084  ctx->fmt_offset += ctx->new_count;
26085  ctx->new_count = 1;
26086  ctx->enc_count = 0;
26087  ctx->enc_type = 0;
26088  ctx->enc_packmode = ctx->new_packmode;
26089  ++ts;
26090  break;
26091  case 'Z':
26092  got_Z = 1;
26093  ++ts;
26094  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
26095  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
26096  return NULL;
26097  }
26098  CYTHON_FALLTHROUGH;
26099  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
26100  case 'l': case 'L': case 'q': case 'Q':
26101  case 'f': case 'd': case 'g':
26102  case 'O': case 'p':
26103  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
26104  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
26105  ctx->enc_count += ctx->new_count;
26106  ctx->new_count = 1;
26107  got_Z = 0;
26108  ++ts;
26109  break;
26110  }
26111  CYTHON_FALLTHROUGH;
26112  case 's':
26113  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26114  ctx->enc_count = ctx->new_count;
26115  ctx->enc_packmode = ctx->new_packmode;
26116  ctx->enc_type = *ts;
26117  ctx->is_complex = got_Z;
26118  ++ts;
26119  ctx->new_count = 1;
26120  got_Z = 0;
26121  break;
26122  case ':':
26123  ++ts;
26124  while(*ts != ':') ++ts;
26125  ++ts;
26126  break;
26127  case '(':
26128  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
26129  break;
26130  default:
26131  {
26132  int number = __Pyx_BufFmt_ExpectNumber(&ts);
26133  if (number == -1) return NULL;
26134  ctx->new_count = (size_t)number;
26135  }
26136  }
26137  }
26138 }
26139 
26140 /* TypeInfoCompare */
26141  static int
26142 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
26143 {
26144  int i;
26145  if (!a || !b)
26146  return 0;
26147  if (a == b)
26148  return 1;
26149  if (a->size != b->size || a->typegroup != b->typegroup ||
26150  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
26151  if (a->typegroup == 'H' || b->typegroup == 'H') {
26152  return a->size == b->size;
26153  } else {
26154  return 0;
26155  }
26156  }
26157  if (a->ndim) {
26158  for (i = 0; i < a->ndim; i++)
26159  if (a->arraysize[i] != b->arraysize[i])
26160  return 0;
26161  }
26162  if (a->typegroup == 'S') {
26163  if (a->flags != b->flags)
26164  return 0;
26165  if (a->fields || b->fields) {
26166  if (!(a->fields && b->fields))
26167  return 0;
26168  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
26169  __Pyx_StructField *field_a = a->fields + i;
26170  __Pyx_StructField *field_b = b->fields + i;
26171  if (field_a->offset != field_b->offset ||
26172  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
26173  return 0;
26174  }
26175  return !a->fields[i].type && !b->fields[i].type;
26176  }
26177  }
26178  return 1;
26179 }
26180 
26181 /* MemviewSliceValidateAndInit */
26182  static int
26183 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
26184 {
26185  if (buf->shape[dim] <= 1)
26186  return 1;
26187  if (buf->strides) {
26188  if (spec & __Pyx_MEMVIEW_CONTIG) {
26189  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
26190  if (unlikely(buf->strides[dim] != sizeof(void *))) {
26191  PyErr_Format(PyExc_ValueError,
26192  "Buffer is not indirectly contiguous "
26193  "in dimension %d.", dim);
26194  goto fail;
26195  }
26196  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
26197  PyErr_SetString(PyExc_ValueError,
26198  "Buffer and memoryview are not contiguous "
26199  "in the same dimension.");
26200  goto fail;
26201  }
26202  }
26203  if (spec & __Pyx_MEMVIEW_FOLLOW) {
26204  Py_ssize_t stride = buf->strides[dim];
26205  if (stride < 0)
26206  stride = -stride;
26207  if (unlikely(stride < buf->itemsize)) {
26208  PyErr_SetString(PyExc_ValueError,
26209  "Buffer and memoryview are not contiguous "
26210  "in the same dimension.");
26211  goto fail;
26212  }
26213  }
26214  } else {
26215  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
26216  PyErr_Format(PyExc_ValueError,
26217  "C-contiguous buffer is not contiguous in "
26218  "dimension %d", dim);
26219  goto fail;
26220  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
26221  PyErr_Format(PyExc_ValueError,
26222  "C-contiguous buffer is not indirect in "
26223  "dimension %d", dim);
26224  goto fail;
26225  } else if (unlikely(buf->suboffsets)) {
26226  PyErr_SetString(PyExc_ValueError,
26227  "Buffer exposes suboffsets but no strides");
26228  goto fail;
26229  }
26230  }
26231  return 1;
26232 fail:
26233  return 0;
26234 }
26235 static int
26236 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
26237 {
26238  if (spec & __Pyx_MEMVIEW_DIRECT) {
26239  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
26240  PyErr_Format(PyExc_ValueError,
26241  "Buffer not compatible with direct access "
26242  "in dimension %d.", dim);
26243  goto fail;
26244  }
26245  }
26246  if (spec & __Pyx_MEMVIEW_PTR) {
26247  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
26248  PyErr_Format(PyExc_ValueError,
26249  "Buffer is not indirectly accessible "
26250  "in dimension %d.", dim);
26251  goto fail;
26252  }
26253  }
26254  return 1;
26255 fail:
26256  return 0;
26257 }
26258 static int
26259 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
26260 {
26261  int i;
26262  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
26263  Py_ssize_t stride = 1;
26264  for (i = 0; i < ndim; i++) {
26265  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26266  PyErr_SetString(PyExc_ValueError,
26267  "Buffer not fortran contiguous.");
26268  goto fail;
26269  }
26270  stride = stride * buf->shape[i];
26271  }
26272  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
26273  Py_ssize_t stride = 1;
26274  for (i = ndim - 1; i >- 1; i--) {
26275  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26276  PyErr_SetString(PyExc_ValueError,
26277  "Buffer not C contiguous.");
26278  goto fail;
26279  }
26280  stride = stride * buf->shape[i];
26281  }
26282  }
26283  return 1;
26284 fail:
26285  return 0;
26286 }
26287 static int __Pyx_ValidateAndInit_memviewslice(
26288  int *axes_specs,
26289  int c_or_f_flag,
26290  int buf_flags,
26291  int ndim,
26292  __Pyx_TypeInfo *dtype,
26293  __Pyx_BufFmt_StackElem stack[],
26294  __Pyx_memviewslice *memviewslice,
26295  PyObject *original_obj)
26296 {
26297  struct __pyx_memoryview_obj *memview, *new_memview;
26298  __Pyx_RefNannyDeclarations
26299  Py_buffer *buf;
26300  int i, spec = 0, retval = -1;
26301  __Pyx_BufFmt_Context ctx;
26302  int from_memoryview = __pyx_memoryview_check(original_obj);
26303  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
26304  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
26305  original_obj)->typeinfo)) {
26306  memview = (struct __pyx_memoryview_obj *) original_obj;
26307  new_memview = NULL;
26308  } else {
26309  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26310  original_obj, buf_flags, 0, dtype);
26311  new_memview = memview;
26312  if (unlikely(!memview))
26313  goto fail;
26314  }
26315  buf = &memview->view;
26316  if (unlikely(buf->ndim != ndim)) {
26317  PyErr_Format(PyExc_ValueError,
26318  "Buffer has wrong number of dimensions (expected %d, got %d)",
26319  ndim, buf->ndim);
26320  goto fail;
26321  }
26322  if (new_memview) {
26323  __Pyx_BufFmt_Init(&ctx, stack, dtype);
26324  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
26325  }
26326  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
26327  PyErr_Format(PyExc_ValueError,
26328  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
26329  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
26330  buf->itemsize,
26331  (buf->itemsize > 1) ? "s" : "",
26332  dtype->name,
26333  dtype->size,
26334  (dtype->size > 1) ? "s" : "");
26335  goto fail;
26336  }
26337  if (buf->len > 0) {
26338  for (i = 0; i < ndim; i++) {
26339  spec = axes_specs[i];
26340  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
26341  goto fail;
26342  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
26343  goto fail;
26344  }
26345  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
26346  goto fail;
26347  }
26348  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
26349  new_memview != NULL) == -1)) {
26350  goto fail;
26351  }
26352  retval = 0;
26353  goto no_fail;
26354 fail:
26355  Py_XDECREF(new_memview);
26356  retval = -1;
26357 no_fail:
26358  __Pyx_RefNannyFinishContext();
26359  return retval;
26360 }
26361 
26362 /* ObjectToMemviewSlice */
26363  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj, int writable_flag) {
26364  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26365  __Pyx_BufFmt_StackElem stack[1];
26366  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26367  int retcode;
26368  if (obj == Py_None) {
26369  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26370  return result;
26371  }
26372  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26373  PyBUF_RECORDS_RO | writable_flag, 1,
26374  &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
26375  &result, obj);
26376  if (unlikely(retcode == -1))
26377  goto __pyx_fail;
26378  return result;
26379 __pyx_fail:
26380  result.memview = NULL;
26381  result.data = NULL;
26382  return result;
26383 }
26384 
26385 /* ObjectToMemviewSlice */
26386  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj, int writable_flag) {
26387  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26388  __Pyx_BufFmt_StackElem stack[1];
26389  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26390  int retcode;
26391  if (obj == Py_None) {
26392  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26393  return result;
26394  }
26395  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26396  PyBUF_RECORDS_RO | writable_flag, 1,
26397  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
26398  &result, obj);
26399  if (unlikely(retcode == -1))
26400  goto __pyx_fail;
26401  return result;
26402 __pyx_fail:
26403  result.memview = NULL;
26404  result.data = NULL;
26405  return result;
26406 }
26407 
26408 /* Declarations */
26409  #if CYTHON_CCOMPLEX
26410  #ifdef __cplusplus
26411  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26412  return ::std::complex< float >(x, y);
26413  }
26414  #else
26415  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26416  return x + y*(__pyx_t_float_complex)_Complex_I;
26417  }
26418  #endif
26419 #else
26420  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26421  __pyx_t_float_complex z;
26422  z.real = x;
26423  z.imag = y;
26424  return z;
26425  }
26426 #endif
26427 
26428 /* Arithmetic */
26429  #if CYTHON_CCOMPLEX
26430 #else
26431  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26432  return (a.real == b.real) && (a.imag == b.imag);
26433  }
26434  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26435  __pyx_t_float_complex z;
26436  z.real = a.real + b.real;
26437  z.imag = a.imag + b.imag;
26438  return z;
26439  }
26440  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26441  __pyx_t_float_complex z;
26442  z.real = a.real - b.real;
26443  z.imag = a.imag - b.imag;
26444  return z;
26445  }
26446  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26447  __pyx_t_float_complex z;
26448  z.real = a.real * b.real - a.imag * b.imag;
26449  z.imag = a.real * b.imag + a.imag * b.real;
26450  return z;
26451  }
26452  #if 1
26453  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26454  if (b.imag == 0) {
26455  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26456  } else if (fabsf(b.real) >= fabsf(b.imag)) {
26457  if (b.real == 0 && b.imag == 0) {
26458  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
26459  } else {
26460  float r = b.imag / b.real;
26461  float s = (float)(1.0) / (b.real + b.imag * r);
26462  return __pyx_t_float_complex_from_parts(
26463  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26464  }
26465  } else {
26466  float r = b.real / b.imag;
26467  float s = (float)(1.0) / (b.imag + b.real * r);
26468  return __pyx_t_float_complex_from_parts(
26469  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26470  }
26471  }
26472  #else
26473  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26474  if (b.imag == 0) {
26475  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26476  } else {
26477  float denom = b.real * b.real + b.imag * b.imag;
26478  return __pyx_t_float_complex_from_parts(
26479  (a.real * b.real + a.imag * b.imag) / denom,
26480  (a.imag * b.real - a.real * b.imag) / denom);
26481  }
26482  }
26483  #endif
26484  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
26485  __pyx_t_float_complex z;
26486  z.real = -a.real;
26487  z.imag = -a.imag;
26488  return z;
26489  }
26490  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
26491  return (a.real == 0) && (a.imag == 0);
26492  }
26493  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
26494  __pyx_t_float_complex z;
26495  z.real = a.real;
26496  z.imag = -a.imag;
26497  return z;
26498  }
26499  #if 1
26500  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
26501  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26502  return sqrtf(z.real*z.real + z.imag*z.imag);
26503  #else
26504  return hypotf(z.real, z.imag);
26505  #endif
26506  }
26507  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26508  __pyx_t_float_complex z;
26509  float r, lnr, theta, z_r, z_theta;
26510  if (b.imag == 0 && b.real == (int)b.real) {
26511  if (b.real < 0) {
26512  float denom = a.real * a.real + a.imag * a.imag;
26513  a.real = a.real / denom;
26514  a.imag = -a.imag / denom;
26515  b.real = -b.real;
26516  }
26517  switch ((int)b.real) {
26518  case 0:
26519  z.real = 1;
26520  z.imag = 0;
26521  return z;
26522  case 1:
26523  return a;
26524  case 2:
26525  return __Pyx_c_prod_float(a, a);
26526  case 3:
26527  z = __Pyx_c_prod_float(a, a);
26528  return __Pyx_c_prod_float(z, a);
26529  case 4:
26530  z = __Pyx_c_prod_float(a, a);
26531  return __Pyx_c_prod_float(z, z);
26532  }
26533  }
26534  if (a.imag == 0) {
26535  if (a.real == 0) {
26536  return a;
26537  } else if (b.imag == 0) {
26538  z.real = powf(a.real, b.real);
26539  z.imag = 0;
26540  return z;
26541  } else if (a.real > 0) {
26542  r = a.real;
26543  theta = 0;
26544  } else {
26545  r = -a.real;
26546  theta = atan2f(0.0, -1.0);
26547  }
26548  } else {
26549  r = __Pyx_c_abs_float(a);
26550  theta = atan2f(a.imag, a.real);
26551  }
26552  lnr = logf(r);
26553  z_r = expf(lnr * b.real - theta * b.imag);
26554  z_theta = theta * b.real + lnr * b.imag;
26555  z.real = z_r * cosf(z_theta);
26556  z.imag = z_r * sinf(z_theta);
26557  return z;
26558  }
26559  #endif
26560 #endif
26561 
26562 /* Declarations */
26563  #if CYTHON_CCOMPLEX
26564  #ifdef __cplusplus
26565  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26566  return ::std::complex< double >(x, y);
26567  }
26568  #else
26569  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26570  return x + y*(__pyx_t_double_complex)_Complex_I;
26571  }
26572  #endif
26573 #else
26574  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26575  __pyx_t_double_complex z;
26576  z.real = x;
26577  z.imag = y;
26578  return z;
26579  }
26580 #endif
26581 
26582 /* Arithmetic */
26583  #if CYTHON_CCOMPLEX
26584 #else
26585  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26586  return (a.real == b.real) && (a.imag == b.imag);
26587  }
26588  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26589  __pyx_t_double_complex z;
26590  z.real = a.real + b.real;
26591  z.imag = a.imag + b.imag;
26592  return z;
26593  }
26594  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26595  __pyx_t_double_complex z;
26596  z.real = a.real - b.real;
26597  z.imag = a.imag - b.imag;
26598  return z;
26599  }
26600  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26601  __pyx_t_double_complex z;
26602  z.real = a.real * b.real - a.imag * b.imag;
26603  z.imag = a.real * b.imag + a.imag * b.real;
26604  return z;
26605  }
26606  #if 1
26607  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26608  if (b.imag == 0) {
26609  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26610  } else if (fabs(b.real) >= fabs(b.imag)) {
26611  if (b.real == 0 && b.imag == 0) {
26612  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
26613  } else {
26614  double r = b.imag / b.real;
26615  double s = (double)(1.0) / (b.real + b.imag * r);
26616  return __pyx_t_double_complex_from_parts(
26617  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26618  }
26619  } else {
26620  double r = b.real / b.imag;
26621  double s = (double)(1.0) / (b.imag + b.real * r);
26622  return __pyx_t_double_complex_from_parts(
26623  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26624  }
26625  }
26626  #else
26627  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26628  if (b.imag == 0) {
26629  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26630  } else {
26631  double denom = b.real * b.real + b.imag * b.imag;
26632  return __pyx_t_double_complex_from_parts(
26633  (a.real * b.real + a.imag * b.imag) / denom,
26634  (a.imag * b.real - a.real * b.imag) / denom);
26635  }
26636  }
26637  #endif
26638  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26639  __pyx_t_double_complex z;
26640  z.real = -a.real;
26641  z.imag = -a.imag;
26642  return z;
26643  }
26644  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26645  return (a.real == 0) && (a.imag == 0);
26646  }
26647  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26648  __pyx_t_double_complex z;
26649  z.real = a.real;
26650  z.imag = -a.imag;
26651  return z;
26652  }
26653  #if 1
26654  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
26655  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26656  return sqrt(z.real*z.real + z.imag*z.imag);
26657  #else
26658  return hypot(z.real, z.imag);
26659  #endif
26660  }
26661  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26662  __pyx_t_double_complex z;
26663  double r, lnr, theta, z_r, z_theta;
26664  if (b.imag == 0 && b.real == (int)b.real) {
26665  if (b.real < 0) {
26666  double denom = a.real * a.real + a.imag * a.imag;
26667  a.real = a.real / denom;
26668  a.imag = -a.imag / denom;
26669  b.real = -b.real;
26670  }
26671  switch ((int)b.real) {
26672  case 0:
26673  z.real = 1;
26674  z.imag = 0;
26675  return z;
26676  case 1:
26677  return a;
26678  case 2:
26679  return __Pyx_c_prod_double(a, a);
26680  case 3:
26681  z = __Pyx_c_prod_double(a, a);
26682  return __Pyx_c_prod_double(z, a);
26683  case 4:
26684  z = __Pyx_c_prod_double(a, a);
26685  return __Pyx_c_prod_double(z, z);
26686  }
26687  }
26688  if (a.imag == 0) {
26689  if (a.real == 0) {
26690  return a;
26691  } else if (b.imag == 0) {
26692  z.real = pow(a.real, b.real);
26693  z.imag = 0;
26694  return z;
26695  } else if (a.real > 0) {
26696  r = a.real;
26697  theta = 0;
26698  } else {
26699  r = -a.real;
26700  theta = atan2(0.0, -1.0);
26701  }
26702  } else {
26703  r = __Pyx_c_abs_double(a);
26704  theta = atan2(a.imag, a.real);
26705  }
26706  lnr = log(r);
26707  z_r = exp(lnr * b.real - theta * b.imag);
26708  z_theta = theta * b.real + lnr * b.imag;
26709  z.real = z_r * cos(z_theta);
26710  z.imag = z_r * sin(z_theta);
26711  return z;
26712  }
26713  #endif
26714 #endif
26715 
26716 /* MemviewSliceCopyTemplate */
26717  static __Pyx_memviewslice
26718 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
26719  const char *mode, int ndim,
26720  size_t sizeof_dtype, int contig_flag,
26721  int dtype_is_object)
26722 {
26723  __Pyx_RefNannyDeclarations
26724  int i;
26725  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
26726  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
26727  Py_buffer *buf = &from_memview->view;
26728  PyObject *shape_tuple = NULL;
26729  PyObject *temp_int = NULL;
26730  struct __pyx_array_obj *array_obj = NULL;
26731  struct __pyx_memoryview_obj *memview_obj = NULL;
26732  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
26733  for (i = 0; i < ndim; i++) {
26734  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
26735  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
26736  "indirect dimensions (axis %d)", i);
26737  goto fail;
26738  }
26739  }
26740  shape_tuple = PyTuple_New(ndim);
26741  if (unlikely(!shape_tuple)) {
26742  goto fail;
26743  }
26744  __Pyx_GOTREF(shape_tuple);
26745  for(i = 0; i < ndim; i++) {
26746  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
26747  if(unlikely(!temp_int)) {
26748  goto fail;
26749  } else {
26750  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
26751  temp_int = NULL;
26752  }
26753  }
26754  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
26755  if (unlikely(!array_obj)) {
26756  goto fail;
26757  }
26758  __Pyx_GOTREF(array_obj);
26759  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26760  (PyObject *) array_obj, contig_flag,
26761  dtype_is_object,
26762  from_mvs->memview->typeinfo);
26763  if (unlikely(!memview_obj))
26764  goto fail;
26765  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
26766  goto fail;
26767  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
26768  dtype_is_object) < 0))
26769  goto fail;
26770  goto no_fail;
26771 fail:
26772  __Pyx_XDECREF(new_mvs.memview);
26773  new_mvs.memview = NULL;
26774  new_mvs.data = NULL;
26775 no_fail:
26776  __Pyx_XDECREF(shape_tuple);
26777  __Pyx_XDECREF(temp_int);
26778  __Pyx_XDECREF(array_obj);
26779  __Pyx_RefNannyFinishContext();
26780  return new_mvs;
26781 }
26782 
26783 /* CIntFromPy */
26784  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
26785 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26786 #pragma GCC diagnostic push
26787 #pragma GCC diagnostic ignored "-Wconversion"
26788 #endif
26789  const int neg_one = (int) -1, const_zero = (int) 0;
26790 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26791 #pragma GCC diagnostic pop
26792 #endif
26793  const int is_unsigned = neg_one > const_zero;
26794 #if PY_MAJOR_VERSION < 3
26795  if (likely(PyInt_Check(x))) {
26796  if (sizeof(int) < sizeof(long)) {
26797  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
26798  } else {
26799  long val = PyInt_AS_LONG(x);
26800  if (is_unsigned && unlikely(val < 0)) {
26801  goto raise_neg_overflow;
26802  }
26803  return (int) val;
26804  }
26805  } else
26806 #endif
26807  if (likely(PyLong_Check(x))) {
26808  if (is_unsigned) {
26809 #if CYTHON_USE_PYLONG_INTERNALS
26810  const digit* digits = ((PyLongObject*)x)->ob_digit;
26811  switch (Py_SIZE(x)) {
26812  case 0: return (int) 0;
26813  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
26814  case 2:
26815  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26816  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26817  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26818  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
26819  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26820  }
26821  }
26822  break;
26823  case 3:
26824  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26825  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26826  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26827  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
26828  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26829  }
26830  }
26831  break;
26832  case 4:
26833  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26834  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26835  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26836  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
26837  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26838  }
26839  }
26840  break;
26841  }
26842 #endif
26843 #if CYTHON_COMPILING_IN_CPYTHON
26844  if (unlikely(Py_SIZE(x) < 0)) {
26845  goto raise_neg_overflow;
26846  }
26847 #else
26848  {
26849  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26850  if (unlikely(result < 0))
26851  return (int) -1;
26852  if (unlikely(result == 1))
26853  goto raise_neg_overflow;
26854  }
26855 #endif
26856  if (sizeof(int) <= sizeof(unsigned long)) {
26857  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
26858 #ifdef HAVE_LONG_LONG
26859  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26860  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26861 #endif
26862  }
26863  } else {
26864 #if CYTHON_USE_PYLONG_INTERNALS
26865  const digit* digits = ((PyLongObject*)x)->ob_digit;
26866  switch (Py_SIZE(x)) {
26867  case 0: return (int) 0;
26868  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
26869  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
26870  case -2:
26871  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
26872  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26873  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26874  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26875  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26876  }
26877  }
26878  break;
26879  case 2:
26880  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26881  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26882  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26883  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26884  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26885  }
26886  }
26887  break;
26888  case -3:
26889  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26890  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26891  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26892  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26893  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26894  }
26895  }
26896  break;
26897  case 3:
26898  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26899  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26900  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26901  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26902  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26903  }
26904  }
26905  break;
26906  case -4:
26907  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26908  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26909  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26910  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26911  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26912  }
26913  }
26914  break;
26915  case 4:
26916  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26917  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26918  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26919  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26920  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26921  }
26922  }
26923  break;
26924  }
26925 #endif
26926  if (sizeof(int) <= sizeof(long)) {
26927  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
26928 #ifdef HAVE_LONG_LONG
26929  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
26930  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
26931 #endif
26932  }
26933  }
26934  {
26935 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26936  PyErr_SetString(PyExc_RuntimeError,
26937  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26938 #else
26939  int val;
26940  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
26941  #if PY_MAJOR_VERSION < 3
26942  if (likely(v) && !PyLong_Check(v)) {
26943  PyObject *tmp = v;
26944  v = PyNumber_Long(tmp);
26945  Py_DECREF(tmp);
26946  }
26947  #endif
26948  if (likely(v)) {
26949  int one = 1; int is_little = (int)*(unsigned char *)&one;
26950  unsigned char *bytes = (unsigned char *)&val;
26951  int ret = _PyLong_AsByteArray((PyLongObject *)v,
26952  bytes, sizeof(val),
26953  is_little, !is_unsigned);
26954  Py_DECREF(v);
26955  if (likely(!ret))
26956  return val;
26957  }
26958 #endif
26959  return (int) -1;
26960  }
26961  } else {
26962  int val;
26963  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26964  if (!tmp) return (int) -1;
26965  val = __Pyx_PyInt_As_int(tmp);
26966  Py_DECREF(tmp);
26967  return val;
26968  }
26969 raise_overflow:
26970  PyErr_SetString(PyExc_OverflowError,
26971  "value too large to convert to int");
26972  return (int) -1;
26973 raise_neg_overflow:
26974  PyErr_SetString(PyExc_OverflowError,
26975  "can't convert negative value to int");
26976  return (int) -1;
26977 }
26978 
26979 /* CIntToPy */
26980  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
26981 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26982 #pragma GCC diagnostic push
26983 #pragma GCC diagnostic ignored "-Wconversion"
26984 #endif
26985  const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
26986 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26987 #pragma GCC diagnostic pop
26988 #endif
26989  const int is_unsigned = neg_one > const_zero;
26990  if (is_unsigned) {
26991  if (sizeof(npy_int32) < sizeof(long)) {
26992  return PyInt_FromLong((long) value);
26993  } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
26994  return PyLong_FromUnsignedLong((unsigned long) value);
26995 #ifdef HAVE_LONG_LONG
26996  } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
26997  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
26998 #endif
26999  }
27000  } else {
27001  if (sizeof(npy_int32) <= sizeof(long)) {
27002  return PyInt_FromLong((long) value);
27003 #ifdef HAVE_LONG_LONG
27004  } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
27005  return PyLong_FromLongLong((PY_LONG_LONG) value);
27006 #endif
27007  }
27008  }
27009  {
27010  int one = 1; int little = (int)*(unsigned char *)&one;
27011  unsigned char *bytes = (unsigned char *)&value;
27012  return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
27013  little, !is_unsigned);
27014  }
27015 }
27016 
27017 /* CIntFromPy */
27018  static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
27019 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27020 #pragma GCC diagnostic push
27021 #pragma GCC diagnostic ignored "-Wconversion"
27022 #endif
27023  const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
27024 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27025 #pragma GCC diagnostic pop
27026 #endif
27027  const int is_unsigned = neg_one > const_zero;
27028 #if PY_MAJOR_VERSION < 3
27029  if (likely(PyInt_Check(x))) {
27030  if (sizeof(npy_int32) < sizeof(long)) {
27031  __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
27032  } else {
27033  long val = PyInt_AS_LONG(x);
27034  if (is_unsigned && unlikely(val < 0)) {
27035  goto raise_neg_overflow;
27036  }
27037  return (npy_int32) val;
27038  }
27039  } else
27040 #endif
27041  if (likely(PyLong_Check(x))) {
27042  if (is_unsigned) {
27043 #if CYTHON_USE_PYLONG_INTERNALS
27044  const digit* digits = ((PyLongObject*)x)->ob_digit;
27045  switch (Py_SIZE(x)) {
27046  case 0: return (npy_int32) 0;
27047  case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
27048  case 2:
27049  if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
27050  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27051  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27052  } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
27053  return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
27054  }
27055  }
27056  break;
27057  case 3:
27058  if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
27059  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27060  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27061  } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
27062  return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
27063  }
27064  }
27065  break;
27066  case 4:
27067  if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
27068  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27069  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27070  } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
27071  return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
27072  }
27073  }
27074  break;
27075  }
27076 #endif
27077 #if CYTHON_COMPILING_IN_CPYTHON
27078  if (unlikely(Py_SIZE(x) < 0)) {
27079  goto raise_neg_overflow;
27080  }
27081 #else
27082  {
27083  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27084  if (unlikely(result < 0))
27085  return (npy_int32) -1;
27086  if (unlikely(result == 1))
27087  goto raise_neg_overflow;
27088  }
27089 #endif
27090  if (sizeof(npy_int32) <= sizeof(unsigned long)) {
27091  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
27092 #ifdef HAVE_LONG_LONG
27093  } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
27094  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27095 #endif
27096  }
27097  } else {
27098 #if CYTHON_USE_PYLONG_INTERNALS
27099  const digit* digits = ((PyLongObject*)x)->ob_digit;
27100  switch (Py_SIZE(x)) {
27101  case 0: return (npy_int32) 0;
27102  case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
27103  case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0])
27104  case -2:
27105  if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
27106  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27107  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27108  } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
27109  return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27110  }
27111  }
27112  break;
27113  case 2:
27114  if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
27115  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27116  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27117  } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
27118  return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27119  }
27120  }
27121  break;
27122  case -3:
27123  if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
27124  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27125  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27126  } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
27127  return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27128  }
27129  }
27130  break;
27131  case 3:
27132  if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
27133  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27134  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27135  } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
27136  return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27137  }
27138  }
27139  break;
27140  case -4:
27141  if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
27142  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27143  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27144  } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
27145  return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27146  }
27147  }
27148  break;
27149  case 4:
27150  if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
27151  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27152  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27153  } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
27154  return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27155  }
27156  }
27157  break;
27158  }
27159 #endif
27160  if (sizeof(npy_int32) <= sizeof(long)) {
27161  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
27162 #ifdef HAVE_LONG_LONG
27163  } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
27164  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
27165 #endif
27166  }
27167  }
27168  {
27169 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27170  PyErr_SetString(PyExc_RuntimeError,
27171  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27172 #else
27173  npy_int32 val;
27174  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27175  #if PY_MAJOR_VERSION < 3
27176  if (likely(v) && !PyLong_Check(v)) {
27177  PyObject *tmp = v;
27178  v = PyNumber_Long(tmp);
27179  Py_DECREF(tmp);
27180  }
27181  #endif
27182  if (likely(v)) {
27183  int one = 1; int is_little = (int)*(unsigned char *)&one;
27184  unsigned char *bytes = (unsigned char *)&val;
27185  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27186  bytes, sizeof(val),
27187  is_little, !is_unsigned);
27188  Py_DECREF(v);
27189  if (likely(!ret))
27190  return val;
27191  }
27192 #endif
27193  return (npy_int32) -1;
27194  }
27195  } else {
27196  npy_int32 val;
27197  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27198  if (!tmp) return (npy_int32) -1;
27199  val = __Pyx_PyInt_As_npy_int32(tmp);
27200  Py_DECREF(tmp);
27201  return val;
27202  }
27203 raise_overflow:
27204  PyErr_SetString(PyExc_OverflowError,
27205  "value too large to convert to npy_int32");
27206  return (npy_int32) -1;
27207 raise_neg_overflow:
27208  PyErr_SetString(PyExc_OverflowError,
27209  "can't convert negative value to npy_int32");
27210  return (npy_int32) -1;
27211 }
27212 
27213 /* CIntFromPy */
27214  static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
27215 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27216 #pragma GCC diagnostic push
27217 #pragma GCC diagnostic ignored "-Wconversion"
27218 #endif
27219  const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
27220 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27221 #pragma GCC diagnostic pop
27222 #endif
27223  const int is_unsigned = neg_one > const_zero;
27224 #if PY_MAJOR_VERSION < 3
27225  if (likely(PyInt_Check(x))) {
27226  if (sizeof(size_t) < sizeof(long)) {
27227  __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
27228  } else {
27229  long val = PyInt_AS_LONG(x);
27230  if (is_unsigned && unlikely(val < 0)) {
27231  goto raise_neg_overflow;
27232  }
27233  return (size_t) val;
27234  }
27235  } else
27236 #endif
27237  if (likely(PyLong_Check(x))) {
27238  if (is_unsigned) {
27239 #if CYTHON_USE_PYLONG_INTERNALS
27240  const digit* digits = ((PyLongObject*)x)->ob_digit;
27241  switch (Py_SIZE(x)) {
27242  case 0: return (size_t) 0;
27243  case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
27244  case 2:
27245  if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
27246  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27247  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27248  } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
27249  return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27250  }
27251  }
27252  break;
27253  case 3:
27254  if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
27255  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27256  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27257  } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
27258  return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27259  }
27260  }
27261  break;
27262  case 4:
27263  if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
27264  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27265  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27266  } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
27267  return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27268  }
27269  }
27270  break;
27271  }
27272 #endif
27273 #if CYTHON_COMPILING_IN_CPYTHON
27274  if (unlikely(Py_SIZE(x) < 0)) {
27275  goto raise_neg_overflow;
27276  }
27277 #else
27278  {
27279  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27280  if (unlikely(result < 0))
27281  return (size_t) -1;
27282  if (unlikely(result == 1))
27283  goto raise_neg_overflow;
27284  }
27285 #endif
27286  if (sizeof(size_t) <= sizeof(unsigned long)) {
27287  __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
27288 #ifdef HAVE_LONG_LONG
27289  } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
27290  __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27291 #endif
27292  }
27293  } else {
27294 #if CYTHON_USE_PYLONG_INTERNALS
27295  const digit* digits = ((PyLongObject*)x)->ob_digit;
27296  switch (Py_SIZE(x)) {
27297  case 0: return (size_t) 0;
27298  case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
27299  case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
27300  case -2:
27301  if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
27302  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27303  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27304  } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
27305  return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27306  }
27307  }
27308  break;
27309  case 2:
27310  if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
27311  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27312  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27313  } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
27314  return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27315  }
27316  }
27317  break;
27318  case -3:
27319  if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
27320  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27321  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27322  } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
27323  return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27324  }
27325  }
27326  break;
27327  case 3:
27328  if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
27329  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27330  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27331  } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
27332  return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27333  }
27334  }
27335  break;
27336  case -4:
27337  if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
27338  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27339  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27340  } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
27341  return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27342  }
27343  }
27344  break;
27345  case 4:
27346  if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
27347  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27348  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27349  } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
27350  return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27351  }
27352  }
27353  break;
27354  }
27355 #endif
27356  if (sizeof(size_t) <= sizeof(long)) {
27357  __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
27358 #ifdef HAVE_LONG_LONG
27359  } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
27360  __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
27361 #endif
27362  }
27363  }
27364  {
27365 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27366  PyErr_SetString(PyExc_RuntimeError,
27367  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27368 #else
27369  size_t val;
27370  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27371  #if PY_MAJOR_VERSION < 3
27372  if (likely(v) && !PyLong_Check(v)) {
27373  PyObject *tmp = v;
27374  v = PyNumber_Long(tmp);
27375  Py_DECREF(tmp);
27376  }
27377  #endif
27378  if (likely(v)) {
27379  int one = 1; int is_little = (int)*(unsigned char *)&one;
27380  unsigned char *bytes = (unsigned char *)&val;
27381  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27382  bytes, sizeof(val),
27383  is_little, !is_unsigned);
27384  Py_DECREF(v);
27385  if (likely(!ret))
27386  return val;
27387  }
27388 #endif
27389  return (size_t) -1;
27390  }
27391  } else {
27392  size_t val;
27393  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27394  if (!tmp) return (size_t) -1;
27395  val = __Pyx_PyInt_As_size_t(tmp);
27396  Py_DECREF(tmp);
27397  return val;
27398  }
27399 raise_overflow:
27400  PyErr_SetString(PyExc_OverflowError,
27401  "value too large to convert to size_t");
27402  return (size_t) -1;
27403 raise_neg_overflow:
27404  PyErr_SetString(PyExc_OverflowError,
27405  "can't convert negative value to size_t");
27406  return (size_t) -1;
27407 }
27408 
27409 /* CIntToPy */
27410  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
27411 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27412 #pragma GCC diagnostic push
27413 #pragma GCC diagnostic ignored "-Wconversion"
27414 #endif
27415  const int neg_one = (int) -1, const_zero = (int) 0;
27416 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27417 #pragma GCC diagnostic pop
27418 #endif
27419  const int is_unsigned = neg_one > const_zero;
27420  if (is_unsigned) {
27421  if (sizeof(int) < sizeof(long)) {
27422  return PyInt_FromLong((long) value);
27423  } else if (sizeof(int) <= sizeof(unsigned long)) {
27424  return PyLong_FromUnsignedLong((unsigned long) value);
27425 #ifdef HAVE_LONG_LONG
27426  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27427  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27428 #endif
27429  }
27430  } else {
27431  if (sizeof(int) <= sizeof(long)) {
27432  return PyInt_FromLong((long) value);
27433 #ifdef HAVE_LONG_LONG
27434  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27435  return PyLong_FromLongLong((PY_LONG_LONG) value);
27436 #endif
27437  }
27438  }
27439  {
27440  int one = 1; int little = (int)*(unsigned char *)&one;
27441  unsigned char *bytes = (unsigned char *)&value;
27442  return _PyLong_FromByteArray(bytes, sizeof(int),
27443  little, !is_unsigned);
27444  }
27445 }
27446 
27447 /* CIntFromPy */
27448  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
27449 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27450 #pragma GCC diagnostic push
27451 #pragma GCC diagnostic ignored "-Wconversion"
27452 #endif
27453  const long neg_one = (long) -1, const_zero = (long) 0;
27454 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27455 #pragma GCC diagnostic pop
27456 #endif
27457  const int is_unsigned = neg_one > const_zero;
27458 #if PY_MAJOR_VERSION < 3
27459  if (likely(PyInt_Check(x))) {
27460  if (sizeof(long) < sizeof(long)) {
27461  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
27462  } else {
27463  long val = PyInt_AS_LONG(x);
27464  if (is_unsigned && unlikely(val < 0)) {
27465  goto raise_neg_overflow;
27466  }
27467  return (long) val;
27468  }
27469  } else
27470 #endif
27471  if (likely(PyLong_Check(x))) {
27472  if (is_unsigned) {
27473 #if CYTHON_USE_PYLONG_INTERNALS
27474  const digit* digits = ((PyLongObject*)x)->ob_digit;
27475  switch (Py_SIZE(x)) {
27476  case 0: return (long) 0;
27477  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
27478  case 2:
27479  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27480  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27481  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27482  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
27483  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27484  }
27485  }
27486  break;
27487  case 3:
27488  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27489  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27490  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27491  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
27492  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27493  }
27494  }
27495  break;
27496  case 4:
27497  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27498  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27499  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27500  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
27501  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27502  }
27503  }
27504  break;
27505  }
27506 #endif
27507 #if CYTHON_COMPILING_IN_CPYTHON
27508  if (unlikely(Py_SIZE(x) < 0)) {
27509  goto raise_neg_overflow;
27510  }
27511 #else
27512  {
27513  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27514  if (unlikely(result < 0))
27515  return (long) -1;
27516  if (unlikely(result == 1))
27517  goto raise_neg_overflow;
27518  }
27519 #endif
27520  if (sizeof(long) <= sizeof(unsigned long)) {
27521  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
27522 #ifdef HAVE_LONG_LONG
27523  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27524  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27525 #endif
27526  }
27527  } else {
27528 #if CYTHON_USE_PYLONG_INTERNALS
27529  const digit* digits = ((PyLongObject*)x)->ob_digit;
27530  switch (Py_SIZE(x)) {
27531  case 0: return (long) 0;
27532  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
27533  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
27534  case -2:
27535  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
27536  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27537  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27538  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27539  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27540  }
27541  }
27542  break;
27543  case 2:
27544  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27545  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27546  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27547  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27548  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27549  }
27550  }
27551  break;
27552  case -3:
27553  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27554  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27555  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27556  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27557  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27558  }
27559  }
27560  break;
27561  case 3:
27562  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27563  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27564  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27565  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27566  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27567  }
27568  }
27569  break;
27570  case -4:
27571  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27572  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27573  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27574  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27575  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27576  }
27577  }
27578  break;
27579  case 4:
27580  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27581  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27582  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27583  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27584  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27585  }
27586  }
27587  break;
27588  }
27589 #endif
27590  if (sizeof(long) <= sizeof(long)) {
27591  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
27592 #ifdef HAVE_LONG_LONG
27593  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27594  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
27595 #endif
27596  }
27597  }
27598  {
27599 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27600  PyErr_SetString(PyExc_RuntimeError,
27601  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27602 #else
27603  long val;
27604  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27605  #if PY_MAJOR_VERSION < 3
27606  if (likely(v) && !PyLong_Check(v)) {
27607  PyObject *tmp = v;
27608  v = PyNumber_Long(tmp);
27609  Py_DECREF(tmp);
27610  }
27611  #endif
27612  if (likely(v)) {
27613  int one = 1; int is_little = (int)*(unsigned char *)&one;
27614  unsigned char *bytes = (unsigned char *)&val;
27615  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27616  bytes, sizeof(val),
27617  is_little, !is_unsigned);
27618  Py_DECREF(v);
27619  if (likely(!ret))
27620  return val;
27621  }
27622 #endif
27623  return (long) -1;
27624  }
27625  } else {
27626  long val;
27627  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27628  if (!tmp) return (long) -1;
27629  val = __Pyx_PyInt_As_long(tmp);
27630  Py_DECREF(tmp);
27631  return val;
27632  }
27633 raise_overflow:
27634  PyErr_SetString(PyExc_OverflowError,
27635  "value too large to convert to long");
27636  return (long) -1;
27637 raise_neg_overflow:
27638  PyErr_SetString(PyExc_OverflowError,
27639  "can't convert negative value to long");
27640  return (long) -1;
27641 }
27642 
27643 /* CIntToPy */
27644  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
27645 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27646 #pragma GCC diagnostic push
27647 #pragma GCC diagnostic ignored "-Wconversion"
27648 #endif
27649  const long neg_one = (long) -1, const_zero = (long) 0;
27650 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27651 #pragma GCC diagnostic pop
27652 #endif
27653  const int is_unsigned = neg_one > const_zero;
27654  if (is_unsigned) {
27655  if (sizeof(long) < sizeof(long)) {
27656  return PyInt_FromLong((long) value);
27657  } else if (sizeof(long) <= sizeof(unsigned long)) {
27658  return PyLong_FromUnsignedLong((unsigned long) value);
27659 #ifdef HAVE_LONG_LONG
27660  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27661  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27662 #endif
27663  }
27664  } else {
27665  if (sizeof(long) <= sizeof(long)) {
27666  return PyInt_FromLong((long) value);
27667 #ifdef HAVE_LONG_LONG
27668  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27669  return PyLong_FromLongLong((PY_LONG_LONG) value);
27670 #endif
27671  }
27672  }
27673  {
27674  int one = 1; int little = (int)*(unsigned char *)&one;
27675  unsigned char *bytes = (unsigned char *)&value;
27676  return _PyLong_FromByteArray(bytes, sizeof(long),
27677  little, !is_unsigned);
27678  }
27679 }
27680 
27681 /* CIntFromPy */
27682  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
27683 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27684 #pragma GCC diagnostic push
27685 #pragma GCC diagnostic ignored "-Wconversion"
27686 #endif
27687  const char neg_one = (char) -1, const_zero = (char) 0;
27688 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27689 #pragma GCC diagnostic pop
27690 #endif
27691  const int is_unsigned = neg_one > const_zero;
27692 #if PY_MAJOR_VERSION < 3
27693  if (likely(PyInt_Check(x))) {
27694  if (sizeof(char) < sizeof(long)) {
27695  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
27696  } else {
27697  long val = PyInt_AS_LONG(x);
27698  if (is_unsigned && unlikely(val < 0)) {
27699  goto raise_neg_overflow;
27700  }
27701  return (char) val;
27702  }
27703  } else
27704 #endif
27705  if (likely(PyLong_Check(x))) {
27706  if (is_unsigned) {
27707 #if CYTHON_USE_PYLONG_INTERNALS
27708  const digit* digits = ((PyLongObject*)x)->ob_digit;
27709  switch (Py_SIZE(x)) {
27710  case 0: return (char) 0;
27711  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
27712  case 2:
27713  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27714  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27715  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27716  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
27717  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27718  }
27719  }
27720  break;
27721  case 3:
27722  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27723  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27724  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27725  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
27726  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27727  }
27728  }
27729  break;
27730  case 4:
27731  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27732  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27733  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27734  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
27735  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27736  }
27737  }
27738  break;
27739  }
27740 #endif
27741 #if CYTHON_COMPILING_IN_CPYTHON
27742  if (unlikely(Py_SIZE(x) < 0)) {
27743  goto raise_neg_overflow;
27744  }
27745 #else
27746  {
27747  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27748  if (unlikely(result < 0))
27749  return (char) -1;
27750  if (unlikely(result == 1))
27751  goto raise_neg_overflow;
27752  }
27753 #endif
27754  if (sizeof(char) <= sizeof(unsigned long)) {
27755  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
27756 #ifdef HAVE_LONG_LONG
27757  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
27758  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27759 #endif
27760  }
27761  } else {
27762 #if CYTHON_USE_PYLONG_INTERNALS
27763  const digit* digits = ((PyLongObject*)x)->ob_digit;
27764  switch (Py_SIZE(x)) {
27765  case 0: return (char) 0;
27766  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
27767  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
27768  case -2:
27769  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
27770  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27771  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27772  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27773  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27774  }
27775  }
27776  break;
27777  case 2:
27778  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27779  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27780  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27781  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27782  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27783  }
27784  }
27785  break;
27786  case -3:
27787  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27788  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27789  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27790  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27791  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27792  }
27793  }
27794  break;
27795  case 3:
27796  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27797  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27798  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27799  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27800  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27801  }
27802  }
27803  break;
27804  case -4:
27805  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27806  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27807  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27808  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27809  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27810  }
27811  }
27812  break;
27813  case 4:
27814  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27815  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27816  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27817  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27818  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27819  }
27820  }
27821  break;
27822  }
27823 #endif
27824  if (sizeof(char) <= sizeof(long)) {
27825  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
27826 #ifdef HAVE_LONG_LONG
27827  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
27828  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
27829 #endif
27830  }
27831  }
27832  {
27833 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27834  PyErr_SetString(PyExc_RuntimeError,
27835  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27836 #else
27837  char val;
27838  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27839  #if PY_MAJOR_VERSION < 3
27840  if (likely(v) && !PyLong_Check(v)) {
27841  PyObject *tmp = v;
27842  v = PyNumber_Long(tmp);
27843  Py_DECREF(tmp);
27844  }
27845  #endif
27846  if (likely(v)) {
27847  int one = 1; int is_little = (int)*(unsigned char *)&one;
27848  unsigned char *bytes = (unsigned char *)&val;
27849  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27850  bytes, sizeof(val),
27851  is_little, !is_unsigned);
27852  Py_DECREF(v);
27853  if (likely(!ret))
27854  return val;
27855  }
27856 #endif
27857  return (char) -1;
27858  }
27859  } else {
27860  char val;
27861  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27862  if (!tmp) return (char) -1;
27863  val = __Pyx_PyInt_As_char(tmp);
27864  Py_DECREF(tmp);
27865  return val;
27866  }
27867 raise_overflow:
27868  PyErr_SetString(PyExc_OverflowError,
27869  "value too large to convert to char");
27870  return (char) -1;
27871 raise_neg_overflow:
27872  PyErr_SetString(PyExc_OverflowError,
27873  "can't convert negative value to char");
27874  return (char) -1;
27875 }
27876 
27877 /* CheckBinaryVersion */
27878  static int __Pyx_check_binary_version(void) {
27879  char ctversion[4], rtversion[4];
27880  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27881  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
27882  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
27883  char message[200];
27884  PyOS_snprintf(message, sizeof(message),
27885  "compiletime version %s of module '%.100s' "
27886  "does not match runtime version %s",
27887  ctversion, __Pyx_MODULE_NAME, rtversion);
27888  return PyErr_WarnEx(NULL, message, 1);
27889  }
27890  return 0;
27891 }
27892 
27893 /* InitStrings */
27894  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27895  while (t->p) {
27896  #if PY_MAJOR_VERSION < 3
27897  if (t->is_unicode) {
27898  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27899  } else if (t->intern) {
27900  *t->p = PyString_InternFromString(t->s);
27901  } else {
27902  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27903  }
27904  #else
27905  if (t->is_unicode | t->is_str) {
27906  if (t->intern) {
27907  *t->p = PyUnicode_InternFromString(t->s);
27908  } else if (t->encoding) {
27909  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27910  } else {
27911  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27912  }
27913  } else {
27914  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27915  }
27916  #endif
27917  if (!*t->p)
27918  return -1;
27919  if (PyObject_Hash(*t->p) == -1)
27920  return -1;
27921  ++t;
27922  }
27923  return 0;
27924 }
27925 
27926 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
27927  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27928 }
27929 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
27930  Py_ssize_t ignore;
27931  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27932 }
27933 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27934 #if !CYTHON_PEP393_ENABLED
27935 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27936  char* defenc_c;
27937  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27938  if (!defenc) return NULL;
27939  defenc_c = PyBytes_AS_STRING(defenc);
27940 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27941  {
27942  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27943  char* c;
27944  for (c = defenc_c; c < end; c++) {
27945  if ((unsigned char) (*c) >= 128) {
27946  PyUnicode_AsASCIIString(o);
27947  return NULL;
27948  }
27949  }
27950  }
27951 #endif
27952  *length = PyBytes_GET_SIZE(defenc);
27953  return defenc_c;
27954 }
27955 #else
27956 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27957  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
27958 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27959  if (likely(PyUnicode_IS_ASCII(o))) {
27960  *length = PyUnicode_GET_LENGTH(o);
27961  return PyUnicode_AsUTF8(o);
27962  } else {
27963  PyUnicode_AsASCIIString(o);
27964  return NULL;
27965  }
27966 #else
27967  return PyUnicode_AsUTF8AndSize(o, length);
27968 #endif
27969 }
27970 #endif
27971 #endif
27972 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27973 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27974  if (
27975 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27976  __Pyx_sys_getdefaultencoding_not_ascii &&
27977 #endif
27978  PyUnicode_Check(o)) {
27979  return __Pyx_PyUnicode_AsStringAndSize(o, length);
27980  } else
27981 #endif
27982 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27983  if (PyByteArray_Check(o)) {
27984  *length = PyByteArray_GET_SIZE(o);
27985  return PyByteArray_AS_STRING(o);
27986  } else
27987 #endif
27988  {
27989  char* result;
27990  int r = PyBytes_AsStringAndSize(o, &result, length);
27991  if (unlikely(r < 0)) {
27992  return NULL;
27993  } else {
27994  return result;
27995  }
27996  }
27997 }
27998 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
27999  int is_true = x == Py_True;
28000  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
28001  else return PyObject_IsTrue(x);
28002 }
28003 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
28004  int retval;
28005  if (unlikely(!x)) return -1;
28006  retval = __Pyx_PyObject_IsTrue(x);
28007  Py_DECREF(x);
28008  return retval;
28009 }
28010 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
28011 #if PY_MAJOR_VERSION >= 3
28012  if (PyLong_Check(result)) {
28013  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28014  "__int__ returned non-int (type %.200s). "
28015  "The ability to return an instance of a strict subclass of int "
28016  "is deprecated, and may be removed in a future version of Python.",
28017  Py_TYPE(result)->tp_name)) {
28018  Py_DECREF(result);
28019  return NULL;
28020  }
28021  return result;
28022  }
28023 #endif
28024  PyErr_Format(PyExc_TypeError,
28025  "__%.4s__ returned non-%.4s (type %.200s)",
28026  type_name, type_name, Py_TYPE(result)->tp_name);
28027  Py_DECREF(result);
28028  return NULL;
28029 }
28030 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28031 #if CYTHON_USE_TYPE_SLOTS
28032  PyNumberMethods *m;
28033 #endif
28034  const char *name = NULL;
28035  PyObject *res = NULL;
28036 #if PY_MAJOR_VERSION < 3
28037  if (likely(PyInt_Check(x) || PyLong_Check(x)))
28038 #else
28039  if (likely(PyLong_Check(x)))
28040 #endif
28041  return __Pyx_NewRef(x);
28042 #if CYTHON_USE_TYPE_SLOTS
28043  m = Py_TYPE(x)->tp_as_number;
28044  #if PY_MAJOR_VERSION < 3
28045  if (m && m->nb_int) {
28046  name = "int";
28047  res = m->nb_int(x);
28048  }
28049  else if (m && m->nb_long) {
28050  name = "long";
28051  res = m->nb_long(x);
28052  }
28053  #else
28054  if (likely(m && m->nb_int)) {
28055  name = "int";
28056  res = m->nb_int(x);
28057  }
28058  #endif
28059 #else
28060  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28061  res = PyNumber_Int(x);
28062  }
28063 #endif
28064  if (likely(res)) {
28065 #if PY_MAJOR_VERSION < 3
28066  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28067 #else
28068  if (unlikely(!PyLong_CheckExact(res))) {
28069 #endif
28070  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28071  }
28072  }
28073  else if (!PyErr_Occurred()) {
28074  PyErr_SetString(PyExc_TypeError,
28075  "an integer is required");
28076  }
28077  return res;
28078 }
28079 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28080  Py_ssize_t ival;
28081  PyObject *x;
28082 #if PY_MAJOR_VERSION < 3
28083  if (likely(PyInt_CheckExact(b))) {
28084  if (sizeof(Py_ssize_t) >= sizeof(long))
28085  return PyInt_AS_LONG(b);
28086  else
28087  return PyInt_AsSsize_t(b);
28088  }
28089 #endif
28090  if (likely(PyLong_CheckExact(b))) {
28091  #if CYTHON_USE_PYLONG_INTERNALS
28092  const digit* digits = ((PyLongObject*)b)->ob_digit;
28093  const Py_ssize_t size = Py_SIZE(b);
28094  if (likely(__Pyx_sst_abs(size) <= 1)) {
28095  ival = likely(size) ? digits[0] : 0;
28096  if (size == -1) ival = -ival;
28097  return ival;
28098  } else {
28099  switch (size) {
28100  case 2:
28101  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28102  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28103  }
28104  break;
28105  case -2:
28106  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28107  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28108  }
28109  break;
28110  case 3:
28111  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28112  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28113  }
28114  break;
28115  case -3:
28116  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28117  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28118  }
28119  break;
28120  case 4:
28121  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28122  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28123  }
28124  break;
28125  case -4:
28126  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28127  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28128  }
28129  break;
28130  }
28131  }
28132  #endif
28133  return PyLong_AsSsize_t(b);
28134  }
28135  x = PyNumber_Index(b);
28136  if (!x) return -1;
28137  ival = PyInt_AsSsize_t(x);
28138  Py_DECREF(x);
28139  return ival;
28140 }
28141 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
28142  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28143 }
28144 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
28145  return PyInt_FromSize_t(ival);
28146 }
28147 
28148 
28149 #endif /* Py_PYTHON_H */
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
ns
Int ns
Definition: Headers.h:30
c
Double c
Definition: Headers.h:54
proteus_superlu.h
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
nnz
#define nnz
Definition: Richards.h:9